Advertisement
Guest User

Untitled

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