Python Tkinter Flashcards
Title
self.master.title(‘WELCOME’)
Geometry
self.master.geometry(‘800x400+100+200’)
Label
self.WelcomeLabel=Label(self.master,text=”Welcome!”,fg=’blue’).grid(row=0,column=3)
Button
self.View=Button(self.master,text=’Histogram’,fg=’blue’,command=self.Histogram).grid(row=14,column=0)
Entry
self.usernameinput = StringVar()
self.usernamein = Entry(self.master,textvariable=self.usernameinput).grid(row=3,column=2)
Place
top = Toplevel(self.master)
top.geometry(“400x200”)
top.title(“Success”)
Label(top, text=”The order has been restored!”).place(x=25,y=15)
Button(top, text=”Return to menu”,command=self.Returningtoadminmenu_restoreordeleteorder).place(x=25,y=95)
CreatingClassConnections
root=Tk()
myGUIMain=Welcome(root)
root.mainloop()
root2=Toplevel(self.master)
muGUI=Main_Menu(root2)
Pack
root = Tk()
root.geometry(‘600x400’)
self.my_listbox = Listbox(root)
self.my_listbox.pack(pady=15)
z = 0
for items in CustomerFinalProducts:
cur.execute(“SELECT ProductName FROM Products WHERE ProductID = ‘” + str(CustomerFinalProducts[z][0]) + “’”)
y = cur.fetchall()
y = y[0]
y = str(y)
CustomerFinalProductsAlternative = str(CustomerFinalProducts[z][1]) + ‘ ‘ + y
self.my_listbox.insert(END, CustomerFinalProductsAlternative,)
count += 2
Othercount += 2
z += 1
Del=Label(root,text=”Type in the number of the product you want deleting…”)
Del.pack(pady=5)
self.OtherDel = Entry(root,textvariable=self.DeletedProduct)
self.OtherDel.pack(pady=10)
CustomerBasketButton = Button(root,text=”Delete”,fg=’blue’,command=self.DeleteAProduct)
CustomerBasketButton.pack(pady=15)