-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy paththree.py
More file actions
32 lines (25 loc) · 775 Bytes
/
three.py
File metadata and controls
32 lines (25 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Imports
from guizero import App, Text, PushButton, Picture
from random import choice
# Functions
def choose_name():
# print("button was pressed")
first_names = ["Shadow", "Pokemon", "Leo", "Itachi"]
last_names = ["Spider", "pikachu", "dragon", "not_uchiha"]
spy_name = choice(first_names) + " " + choice(last_names)
# print(spy_name)
name.value = spy_name
# App
app = App(title = "TOP SECRET")
# Widgets
title = Text(app, "Push the big red button to find out your spy name")
button = PushButton(app, choose_name, text = "Tell me!")
button.bg = "red"
# button.height = 5
# button.width = 20
button.text_size = 20
name = Text(app, text = "")
name.text_size = 20
red_guy = Picture(app, image = "among_us_red_guy.png")
# Display
app.display()