Advertisement
Felanpro

dice game

May 21st, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. from tkinter import * #Import every function from tkinter
  2. from random import randint
  3.  
  4. def throw():
  5.     text.delete(0.0, END)
  6.     text.insert(END, str(randint(1, 6)))
  7.  
  8. window = Tk()
  9.  
  10. text = Text(window, width=1, height=1)
  11. button1 = Button(window, text="Click to throw", command=throw)
  12.  
  13. #Add the variables to the window.
  14. text.pack()
  15. button1.pack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement