Advertisement
Guest User

Untitled

a guest
Dec 8th, 2013
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. from Tkinter import *
  2. import time
  3.  
  4. s = 1
  5.  
  6. def stopit():
  7. global s
  8. s = 1
  9. print "stopped"
  10.  
  11. def callback():
  12. s = 0
  13. if s == 0:
  14. print "called the callback!"
  15. root.after(3000, callback)
  16.  
  17. root = Tk()
  18. root.geometry("200x200+200+200")
  19.  
  20. b = Button(root, text="START", command=callback)
  21. b2 = Button(root, text="STOP", command=stopit)
  22. b.pack()
  23. b2.pack()
  24. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement