Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|