点击按钮改变标签的内容
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()