Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,11 +8,17 @@ def guess(num):
|
|
8 |
else:
|
9 |
r = 'ลองกดใหม่นะ'
|
10 |
return r
|
|
|
|
|
|
|
|
|
11 |
with gr.Blocks() as myApp:
|
12 |
with gr.Row():
|
13 |
with gr.Column(scale=1):
|
14 |
inp = gr.Radio(choices=list(range(10)),label='เลือก 1 หมายเลข')
|
|
|
15 |
with gr.Column(scale=1):
|
16 |
out = gr.Textbox(label='ผลลัพธ์')
|
17 |
-
inp.change(guess,inp,out)
|
|
|
18 |
myApp.launch()
|
|
|
8 |
else:
|
9 |
r = 'ลองกดใหม่นะ'
|
10 |
return r
|
11 |
+
|
12 |
+
def answer():
|
13 |
+
return 'เลขที่สุ่มได้คือ '+str(rand)
|
14 |
+
|
15 |
with gr.Blocks() as myApp:
|
16 |
with gr.Row():
|
17 |
with gr.Column(scale=1):
|
18 |
inp = gr.Radio(choices=list(range(10)),label='เลือก 1 หมายเลข')
|
19 |
+
btn = gr.Button(value="เฉลย")
|
20 |
with gr.Column(scale=1):
|
21 |
out = gr.Textbox(label='ผลลัพธ์')
|
22 |
+
inp.change(guess,inp,out)
|
23 |
+
btn.click(fn=answer,outputs=out)
|
24 |
myApp.launch()
|