Omnibus commited on
Commit
4a5a872
·
verified ·
1 Parent(s): 4e139dd

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ mf={
4
+ "Heading1":"#",
5
+ "Heading2":"##",
6
+ "Heading3":"###",
7
+ }
8
+
9
+ def upd(inp,format):
10
+ line=mf[format]+inp
11
+ return line
12
+ with gr.Blocks() as app:
13
+ format=gr.Dropdown(label="Line Format",choices=[m for m in list(mf.keys())])
14
+ txt=gr.Textbox()
15
+ btn=gr.Button()
16
+ prev=gr.HTML()
17
+ btn.click(upd,[txt,format],prev)
18
+ app.launch()