#========================
#use python version3.6.2
#tkinter
#========================
from tkinter import *
win=Tk()
win.title("Tk GUI")
label=Label(win, text="Hello
World!")
count=0
def clickOK():
global count
count=count + 1
label.configure(text="Click OK " + str(count) + "
times")
button=Button(win, text="OK",
command=clickOK)
label.pack()
button.pack()
win.mainloop()
沒有留言:
張貼留言