-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhatchoice.py
More file actions
25 lines (25 loc) · 901 Bytes
/
hatchoice.py
File metadata and controls
25 lines (25 loc) · 901 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
"""
This program randomly selects and outputs an object in a list
Author: Jacob Olshanskiy
Date: 4-26-22
"""
import random
import tkinter as tk
root = tk.Tk()
root.geometry("600x300")
name_var = tk.StringVar()
passw_var = tk.StringVar()
def submit():
hats = ['Alo', 'JSC', 'SpaceX', 'UTHR', 'FIRST CMP', 'Plain Gray']
hatchoice = random.choice(hats)
print(hatchoice)
name_var.set("")
passw_var.set("")
name_label = tk.Label(root, text='Hello, I will make picking your hat much easier', font=('calibre', 10, 'bold'))
name_entry = tk.Label(root, text="When you are ready type choose and press submit", font=('calibre', 10, 'bold'))
name_start = tk.Entry(root, textvariable=name_var, font=('calibre', 10, 'normal'))
sub_btn = tk.Button(root, text='Submit', command=submit)
name_label.grid(row=0, column=0)
name_entry.grid(row=1, column=0)
sub_btn.grid(row=2, column=1)
root.mainloop()