Advertisement
timber101

GUIZERO - Spy Name Creator

Jul 8th, 2021
1,290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. # Spy Name Chooser
  2.  
  3. #  Imports
  4. from guizero import App, Text, PushButton
  5. from random import choice
  6.  
  7. #  Functions
  8. def choose_name():
  9.     #print("Button was pressed")
  10.     first_names = ["Gerald", "Pythagorus", "Ronald", "Smokey", "Pragya", "Vinnodh", "Colin"]
  11.     last_names = ["Dungeon", "Ferry", "Burning Bush", "Tommo", "Sidewinder", "Yevtushenko"]
  12.     spy_name = choice(first_names) + " " + choice(last_names)
  13.     #print(spy_name)
  14.     spyz_name.value = spy_name
  15.  
  16.  
  17. #  App
  18. my_app = App("TOP SECRET")
  19.  
  20. #  Widgets
  21. title = Text(my_app, "Push the red button to find your spy name")
  22.  
  23. btn = PushButton(my_app, choose_name, text = "Tell me!"  )
  24. btn.bg = "red"
  25. btn.text_size = 30
  26. btn.text_color = "yellow"
  27. btn.font = "Dosis ExtraBold"
  28.  
  29. spyz_name = Text(my_app, text = "", size = 25, color = "blue")
  30.  
  31.  
  32. #  Display()
  33. my_app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement