from Tkinter import*
def click_up():
    counter.set(counter.get()+1)
def click_down():
    counter.set(counter.get()-1)
#if __name__= "__main__":
window=Tk()
counter=IntVar()
counter.set(0)
frame=Frame(window)
frame.pack()
button1=Button(frame,text='UP',command=click_up)
button1.pack()
button2=Button(frame,text='DOWN',command=click_down)
button2.pack()
label=Label(frame,textvariable=counter)
label.pack()
window.mainloop()


相关文章:

  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案