Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Spy Name Chooser
- # Imports
- from guizero import App, Text, PushButton
- from random import choice
- # Functions
- def choose_name():
- #print("Button was pressed")
- first_names = ["Gerald", "Pythagorus", "Ronald", "Smokey", "Pragya", "Vinnodh", "Colin"]
- last_names = ["Dungeon", "Ferry", "Burning Bush", "Tommo", "Sidewinder", "Yevtushenko"]
- spy_name = choice(first_names) + " " + choice(last_names)
- #print(spy_name)
- spyz_name.value = spy_name
- # App
- my_app = App("TOP SECRET")
- # Widgets
- title = Text(my_app, "Push the red button to find your spy name")
- btn = PushButton(my_app, choose_name, text = "Tell me!" )
- btn.bg = "red"
- btn.text_size = 30
- btn.text_color = "yellow"
- btn.font = "Dosis ExtraBold"
- spyz_name = Text(my_app, text = "", size = 25, color = "blue")
- # Display()
- my_app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement