Im trying to make a simple GUI with Tkinker that, when you press a button it adds 1 to the text on a label. However, the label simply remains at 0. Is there a way I can refresh it so it stays up-to-date?
heres what i have so far:
from Tkinter import * clicks = 0 def click(): global clicks global Window clicks += 1 print 'ok', clicks def close_window(): global Window Window.destroy() Window = Tk() Number = Label(text = clicks) close = Button(Window , text='exit' , command = close_window) button = Button(Window,text = 'clickme' ,command = click) button.pack() close.pack() Number.pack() Window.mainloop()