-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot_gui.py
More file actions
49 lines (42 loc) · 1.29 KB
/
bot_gui.py
File metadata and controls
49 lines (42 loc) · 1.29 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from tkinter import *
from tkinter import filedialog
import hot_topic_bot
import hottopic_gui
import funko_gui
import target_gui
website = ''
window = Tk()
window.title("Item Purchase Bot")
mainframe = Frame(window)
mainframe.grid(column=0,row=0, sticky=(N,W,E,S) )
mainframe.columnconfigure(0, weight = 1)
mainframe.rowconfigure(0, weight = 1)
mainframe.pack(pady = 100, padx = 100)
tkvar = StringVar(window)
choices = { 'Hottopic','Target','Funko'}
tkvar.set('Hottopic') # set the default option
popupMenu = OptionMenu(mainframe, tkvar, *choices)
Label(mainframe, text="What website would you like to bot?").grid(row = 1, column = 1)
popupMenu.grid(row = 2, column =1)
# on change dropdown value
def change_dropdown(*args):
print( tkvar.get() )
website = tkvar.get()
# link function to change dropdown
tkvar.trace('w', change_dropdown)
def changeGui ():
website = tkvar.get()
if(website == 'Hottopic'):
window.destroy()
hot = hottopic_gui.hottopic_gui()
elif(website == 'Funko'):
window.destroy()
funko = funko_gui.funko_gui()
elif(website == 'Target'):
window.destroy()
target = target_gui.target_gui()
else:
print(website)
run_bot_button = Button(text = "Run", command = changeGui)
run_bot_button.pack()
window.mainloop()