Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def execute(code, lang):
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
demo = gr.Interface(
|
| 8 |
fn=execute,
|
|
@@ -11,16 +14,15 @@ demo = gr.Interface(
|
|
| 11 |
show_label=True,
|
| 12 |
label="Code",
|
| 13 |
max_lines=4_294_967_295,
|
| 14 |
-
lines=4_294_967_295
|
| 15 |
),
|
| 16 |
gr.Dropdown(
|
| 17 |
show_label=True,
|
| 18 |
label="Language",
|
| 19 |
-
choices=["Python"]
|
| 20 |
-
)
|
| 21 |
],
|
| 22 |
-
outputs="
|
| 23 |
-
|
| 24 |
)
|
| 25 |
|
| 26 |
demo.launch(debug=True)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def execute(code, lang):
|
| 4 |
+
match lang:
|
| 5 |
+
case "Python":
|
| 6 |
+
return "Python
|
| 7 |
+
case _:
|
| 8 |
+
return f"Code : {str(code)}\nTypeof lang : {str(type(lang))}\nLanguage : {str(lang)}"
|
| 9 |
|
| 10 |
demo = gr.Interface(
|
| 11 |
fn=execute,
|
|
|
|
| 14 |
show_label=True,
|
| 15 |
label="Code",
|
| 16 |
max_lines=4_294_967_295,
|
| 17 |
+
lines=4_294_967_295,
|
| 18 |
),
|
| 19 |
gr.Dropdown(
|
| 20 |
show_label=True,
|
| 21 |
label="Language",
|
| 22 |
+
choices=["Python"],
|
| 23 |
+
),
|
| 24 |
],
|
| 25 |
+
outputs=gr.Textbox(label="Result")
|
|
|
|
| 26 |
)
|
| 27 |
|
| 28 |
demo.launch(debug=True)
|