Spaces:
Sleeping
Sleeping
Update run.py
Browse files
run.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import main
|
| 2 |
|
| 3 |
directory = "./app"
|
|
@@ -6,5 +7,12 @@ purpose = """A terminal based game
|
|
| 6 |
- the user must guess a number between 0-100
|
| 7 |
- the game will reply if the number is higher or lower
|
| 8 |
"""
|
| 9 |
-
|
| 10 |
-
main.run(purpose, directory)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
import main
|
| 3 |
|
| 4 |
directory = "./app"
|
|
|
|
| 7 |
- the user must guess a number between 0-100
|
| 8 |
- the game will reply if the number is higher or lower
|
| 9 |
"""
|
| 10 |
+
def run_fn(purpose=purpose):
|
| 11 |
+
outp = main.run(purpose, directory)
|
| 12 |
+
yield outp
|
| 13 |
+
with gr.Blocks() as iface:
|
| 14 |
+
in_field = gr.Textbox(lines=4)
|
| 15 |
+
button = gr.Button()
|
| 16 |
+
out_field = gr.Textbox(lines=8)
|
| 17 |
+
button.click(run_fn,in_field,out_field)
|
| 18 |
+
iface.launch()
|