Advertisement
Guest User

sy

a guest
May 27th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import tkinter, sys, random
  2. from tkinter import messagebox
  3. def zmiana():
  4. global liczba
  5. liczba = random.randint(1, s.get())
  6.  
  7. def koniec():
  8. sys.exit()
  9.  
  10. def sprawdz():
  11. x = int(e.get())
  12. if x>liczba:
  13. messagebox.showinfo(title = "Uwaga", message = "Moja liczba jest mniejsza od Twojej")
  14.  
  15. if x <liczba:
  16. messagebox.showinfo(title = "Uwaga", message = "Moja liczba jest większa od Twojej")
  17. if x == liczba:
  18. messagebox.showinfo(title = "Gratulacje", message = "Brawo zgadl‚es")
  19. def nowagra():
  20. liczba = random.randint(1, s.get())
  21. x = 0
  22. l.config(text = "")
  23. random.seed()
  24. main = tkinter.Tk()
  25.  
  26. liczba = random.randint(1, s.get)
  27. x = 0
  28. e = tkinter.Entry(main, justify = "center")
  29. l = tkinter.Label(main, text = "Posuwając suwakiem zmień zakres liczb")
  30. b = tkinter.Button(main, text = "Zakończ", command = koniec)
  31. b2 = tkinter.Button(main, text = "Sprawdz", command = sprawdz)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement