Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- import time
- s = 1
- def stopit():
- global s
- s = 1
- print "stopped"
- def callback():
- s = 0
- if s == 0:
- print "called the callback!"
- root.after(3000, callback)
- root = Tk()
- root.geometry("200x200+200+200")
- b = Button(root, text="START", command=callback)
- b2 = Button(root, text="STOP", command=stopit)
- b.pack()
- b2.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement