Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import random as rd
|
|
| 5 |
|
| 6 |
def guess(num,rand):
|
| 7 |
num = int(num)
|
|
|
|
| 8 |
if num == rand:
|
| 9 |
r = 'ทายถูกแล้ว'
|
| 10 |
else:
|
|
@@ -28,7 +29,7 @@ with gr.Blocks() as myApp:
|
|
| 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()
|
|
|
|
| 5 |
|
| 6 |
def guess(num,rand):
|
| 7 |
num = int(num)
|
| 8 |
+
rand = int(rand)
|
| 9 |
if num == rand:
|
| 10 |
r = 'ทายถูกแล้ว'
|
| 11 |
else:
|
|
|
|
| 29 |
with gr.Column(scale=1):
|
| 30 |
out = gr.Textbox(label='ผลลัพธ์')
|
| 31 |
|
| 32 |
+
inp.change(guess,[inp,str(rand)],out)
|
| 33 |
btn.click(fn=answer,outputs=out)
|
| 34 |
btn2.click(fn=newRand,outputs=out)
|
| 35 |
myApp.launch()
|