sonobit commited on
Commit
bd92e86
·
1 Parent(s): d1782d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
2
  import random as rd
3
 
4
  rand = rd.randint(0,9)
5
- btn2 = None
6
 
7
  def guess(num):
8
  num = int(num)
@@ -15,11 +14,11 @@ def guess(num):
15
  def answer():
16
  return str(rand)
17
 
18
- def newRand():
19
- rand = rd.randint(0,9)
20
- return ''
21
 
22
  with gr.Blocks() as myApp:
 
 
 
23
  with gr.Row():
24
  with gr.Column(scale=1):
25
  inp = gr.Radio(choices=list(range(10)),label='เลือก 1 หมายเลข')
@@ -30,5 +29,5 @@ with gr.Blocks() as myApp:
30
 
31
  inp.change(guess,inp,out)
32
  btn.click(fn=answer,outputs=out)
33
- btn2.click(fn=newRand,outputs=out)
34
  myApp.launch()
 
2
  import random as rd
3
 
4
  rand = rd.randint(0,9)
 
5
 
6
  def guess(num):
7
  num = int(num)
 
14
  def answer():
15
  return str(rand)
16
 
 
 
 
17
 
18
  with gr.Blocks() as myApp:
19
+ def newRand():
20
+ rand = rd.randint(0,9)
21
+ return ''
22
  with gr.Row():
23
  with gr.Column(scale=1):
24
  inp = gr.Radio(choices=list(range(10)),label='เลือก 1 หมายเลข')
 
29
 
30
  inp.change(guess,inp,out)
31
  btn.click(fn=answer,outputs=out)
32
+ btn2.click(fn=newRand,outputs=out)
33
  myApp.launch()