Update app.py
Browse files
app.py
CHANGED
@@ -13,11 +13,11 @@ def guess(num):
|
|
13 |
return r
|
14 |
|
15 |
def answer():
|
16 |
-
return '
|
17 |
|
18 |
-
|
19 |
rand[0] = rd.randint(0,9)
|
20 |
-
return
|
21 |
|
22 |
with gr.Blocks() as myApp:
|
23 |
with gr.Row():
|
@@ -30,6 +30,6 @@ with gr.Blocks() as myApp:
|
|
30 |
|
31 |
inp.change(guess,inp,out)
|
32 |
btn.click(fn=answer,outputs=out)
|
33 |
-
btn2.click(fn=newRand,
|
34 |
myApp.launch()
|
35 |
|
|
|
13 |
return r
|
14 |
|
15 |
def answer():
|
16 |
+
return 'เลขที่สุ่มได้'+str(rand[0])
|
17 |
|
18 |
+
def newRand():
|
19 |
rand[0] = rd.randint(0,9)
|
20 |
+
return 'สุ่มใหม่แล้วเด้ออ้าย'
|
21 |
|
22 |
with gr.Blocks() as myApp:
|
23 |
with gr.Row():
|
|
|
30 |
|
31 |
inp.change(guess,inp,out)
|
32 |
btn.click(fn=answer,outputs=out)
|
33 |
+
btn2.click(fn=newRand,outputs=out)
|
34 |
myApp.launch()
|
35 |
|