RosettaCodeData/Task/Simple-windowed-application/Python/simple-windowed-application-1.py
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

13 lines
271 B
Python

from Tkinter import Tk, Label, Button
def update_label():
global n
n += 1
l["text"] = "Number of clicks: %d" % n
w = Tk()
n = 0
l = Label(w, text="There have been no clicks yet")
l.pack()
Button(w, text="click me", command=update_label).pack()
w.mainloop()