Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from Tkinter import *
  2.  
  3. root = Tk()
  4.  
  5. x = 0
  6.  
  7. w = Label(root, text="Hello, world!")
  8. w.pack()
  9.  
  10. def callback():
  11. global x
  12. x = x + 10
  13. w.config(text = "Score = "+ str(x))
  14.  
  15. button = Button(root, text="QUIT", fg="red", command=root.quit)
  16. button.pack(side=LEFT)
  17.  
  18. work = Button(root, text="Go!", fg="red", command=callback)
  19. work.pack(side=RIGHT)
  20.  
  21. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement