Update app.py
Browse files
app.py
CHANGED
|
@@ -22,13 +22,13 @@ with gr.Blocks() as myApp:
|
|
| 22 |
return str(rand)
|
| 23 |
with gr.Row():
|
| 24 |
with gr.Column(scale=1):
|
| 25 |
-
inp =
|
| 26 |
btn = gr.Button(value="เฉลย")
|
| 27 |
btn2 = gr.Button(value="สุ่มใหม่")
|
| 28 |
with gr.Column(scale=1):
|
| 29 |
out = gr.Textbox(label='ผลลัพธ์')
|
| 30 |
|
| 31 |
-
inp.change(guess,inp,out)
|
| 32 |
btn.click(fn=answer,outputs=out)
|
| 33 |
btn2.click(fn=newRand,outputs=out)
|
| 34 |
myApp.launch()
|
|
|
|
| 22 |
return str(rand)
|
| 23 |
with gr.Row():
|
| 24 |
with gr.Column(scale=1):
|
| 25 |
+
inp = gr.Radio(choices=list(range(10)),label='เลือก 1 หมายเลข')
|
| 26 |
btn = gr.Button(value="เฉลย")
|
| 27 |
btn2 = gr.Button(value="สุ่มใหม่")
|
| 28 |
with gr.Column(scale=1):
|
| 29 |
out = gr.Textbox(label='ผลลัพธ์')
|
| 30 |
|
| 31 |
+
inp.change(guess,[inp,rand],out)
|
| 32 |
btn.click(fn=answer,outputs=out)
|
| 33 |
btn2.click(fn=newRand,outputs=out)
|
| 34 |
myApp.launch()
|