Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import Tk, StringVar, ttk, messagebox
- from tkinter import*
- import time;
- usrName = ""
- logInStatus = False
- def logMeIn():
- window=Tk()
- l1 =Label(window,text='username: ')
- l2 =Label(window,text='password: ')
- t1 =Entry(window,textvariable=StringVar())
- t2 =Entry(window,show='*',textvariable=StringVar())
- def authorisation():
- username = t1.get()
- global usrName
- usrName = username
- password=t2.get()
- global logInStatus
- if(username=='T170555') and (password=='0000'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='T170632') and (password=='0001'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170300') and (password=='0002'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170301') and (password=='0003'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170302') and (password=='0004'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170303') and (password=='0005'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170304') and (password=='0006'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170305') and (password=='0007'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170306') and (password=='0008'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170307') and (password=='0009'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170308') and (password=='0010'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170309') and (password=='0011'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170400') and (password=='0012'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170401') and (password=='0013'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170402') and (password=='0014'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170403') and (password=='0015'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170404') and (password=='0016'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170405') and (password=='0017'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170406') and (password=='0018'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170407') and (password=='0019'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170408') and (password=='0020'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170409') and (password=='0021'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170500') and (password=='0022'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170501') and (password=='0023'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170502') and (password=='0024'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170503') and (password=='0025'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170504') and (password=='0026'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170505') and (password=='0027'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170506') and (password=='0028'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170507') and (password=='0029'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170508') and (password=='0030'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- elif(username=='S170509') and (password=='0031'):
- print('you have successfully logged in')
- messagebox.showinfo('Successful log in', 'you have successfully logged in')
- logInStatus = True
- else:
- print('details entered are incorrect, please try again')
- messagebox.showinfo('Unsucessful log in', 'details entered are incorrect, please try again')
- logInStatus = False
- b1 =Button(window,text='log in',command=authorisation)
- l1.pack()
- t1.pack()
- l2.pack()
- t2.pack()
- b1.pack()
- window.mainloop()
- def AttendanceResister():
- root = Tk()
- root.title("Attendance Register")
- root.configure(background='black')
- frame = Frame(root)
- frame.pack()
- LFrame = Frame(root, width=1350, height=650, bd=8, relief="flat")
- LFrame.pack(fill=BOTH, expand=1)
- LFrame0 = Frame(LFrame, width=1350, height=50, bd=8, relief="raise")
- LFrame0.pack(fill=X, side=TOP)
- LFrame1 = Frame(LFrame, width=1350, height=50, bd=8, relief="raise")
- LFrame1.pack(fill=X, side=TOP)
- LFrame2 = Frame(LFrame, width=1350, height=100, bd=8, relief="raise")
- LFrame2.pack(fill=X, side=TOP)
- DateofOrder = StringVar()
- value0 = StringVar()
- value1 = StringVar()
- value2 = StringVar()
- value3 = StringVar()
- value4 = StringVar()
- value5 = StringVar()
- value6 = StringVar()
- value7 = StringVar()
- value8 = StringVar()
- value9 = StringVar()
- value10 = StringVar()
- value11 = StringVar()
- value12 = StringVar()
- def Mark_Register():
- if value0.get() == "/":
- value1.set("/")
- value2.set("/")
- value3.set("/")
- value4.set("/")
- value5.set("/")
- value6.set("/")
- value7.set("/")
- value8.set("/")
- value9.set("/")
- value10.set("/")
- value11.set("/")
- value12.set("/")
- elif (value0.get() == "Late"):
- value1.set("Late")
- value2.set("Late")
- value3.set("Late")
- value4.set("Late")
- value5.set("Late")
- value6.set("Late")
- value7.set("Late")
- value8.set("Late")
- value9.set("Late")
- value10.set("Late")
- value11.set("Late")
- value12.set("Late")
- elif (value0.get() == "Presence"):
- value1.set("Presence")
- value2.set("Presence")
- value3.set("Presence")
- value4.set("Presence")
- value5.set("Presence")
- value6.set("Presence")
- value7.set("Presence")
- value8.set("Presence")
- value9.set("Presence")
- value10.set("Presence")
- value11.set("Presence")
- value12.set("Presence")
- elif (value0.get() == "Excused"):
- value1.set("Excused")
- value2.set("Excused")
- value3.set("Excused")
- value4.set("Excused")
- value5.set("Excused")
- value6.set("Excused")
- value7.set("Excused")
- value8.set("Excused")
- value9.set("Excused")
- value10.set("Excused")
- value11.set("Excused")
- value12.set("Excused")
- def Reset():
- value0.set("")
- value1.set("")
- value2.set("")
- value3.set("")
- value4.set("")
- value5.set("")
- value6.set("")
- value7.set("")
- value8.set("")
- value9.set("")
- value10.set("")
- value11.set("")
- value12.set("")
- def qExit():
- qExit = messagebox.askyesno("Exit system", "Do you want to quit")
- if qExit > 0:
- root.destroy()
- return
- DateofOrder.set(time.strftime("%d/%m/%Y"))
- Header = Label(LFrame0, font=('courier', 14, 'bold'), text="Class A Attendance", bd=15)
- Header.pack(fill=X, expand=1)
- lStudentNo = Label(LFrame1, font=('courier', 14, 'bold'), text="Student No.", bd=15)
- lStudentNo.grid(row=0, column=1, sticky=W)
- lStudentName = Label(LFrame1, font=('courier', 14, 'bold'), text="Student Name", bd=15)
- lStudentName.grid(row=0, column=2, sticky=W)
- lCourseCode = Label(LFrame1, font=('courier', 14, 'bold'), text="Course Code ", bd=15)
- lCourseCode.grid(row=0, column=3, sticky=W)
- box = ttk.Combobox(LFrame1, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=0, column=4)
- DateofOrder.set(time.strftime("%d/%m/%Y"))
- btnFill = Button(LFrame1, text='Fill', padx=2, pady=2, bd=15, fg="black",
- font=('arial', 10, 'bold'), width=12, height=1, command=Mark_Register).grid(row=0, column=5)
- btnReset = Button(LFrame1, text='Reset', padx=2, pady=2, bd=15, fg="black",
- font=('arial', 10, 'bold'), width=12, height=1, command=Reset).grid(row=0, column=6)
- btnExit = Button(LFrame1, text='Exit', padx=2, pady=2, bd=15, fg="black",
- font=('arial', 10, 'bold'), width=12, height=1, command=qExit).grid(row=0, column=7)
- # -------------------------------------------------------------------------------------------------------
- DateofOrder = Label(LFrame1, font=('arial', 10, 'bold'), textvariable=DateofOrder, padx=2,
- pady=2, bd=2, fg="black", bg='white', relief='sunken')
- DateofOrder.grid(row=0, column=8, sticky=W)
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170300", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=0, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Alice Butler", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=0, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=0, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=0, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=0, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=0, column=6)
- # ---------------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170301", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=1, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Aaron Keller", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=1, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=1, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=1, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=1, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=1, column=6)
- # ------------------------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170302", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=2, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Noel MacGuire", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=2, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=2, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=2, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=2, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=2, column=6)
- # ----------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170303", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=3, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Rene Mccarthy", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=3, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=3, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=3, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=3, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=3, column=6)
- # ----------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170304", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=4, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Margret Nelson", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=4, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=4, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=4, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=4, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=4, column=6)
- # ---------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170305", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=5, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Angelina Norton", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=5, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=5, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=5, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=5, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=5, column=6)
- # --------------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170306", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=6, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Christopher Reese", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=6, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=6, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=6, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=6, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=6, column=6)
- # ---------------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170307", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=7, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Nelson Rowe", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=7, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=7, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=7, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=7, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=7, column=6)
- # --------------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170308", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=8, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Monica Smith", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=8, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=8, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=8, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=8, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=8, column=6)
- # -----------------------------------------------------------------------------------------
- StudentNo1 = Label(LFrame2, font=('courier', 14, 'bold'), text="S170309", padx=2,
- pady=2, bd=15, fg="black", width=12)
- StudentNo1.grid(row=9, column=1, sticky=W)
- Student_Name = Label(LFrame2, font=('courier', 14, 'bold'), text="Allen Waters", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Student_Name.grid(row=9, column=2, sticky=W)
- Course_Code = Label(LFrame2, font=('courier', 14, 'bold'), text="Course Code", padx=2,
- pady=2, bd=15, fg="black", width=12)
- Course_Code.grid(row=9, column=3, sticky=W)
- box = ttk.Combobox(LFrame2, textvariable=value0, state='readonly')
- box['values'] = (' ', 'Late', 'Presence', 'Excused')
- box.current(0)
- box.grid(row=9, column=4)
- Label(LFrame2, text="Enter Excused Reason").grid(row=9, column=5)
- E1 = Entry(LFrame2)
- E1.grid(row=9, column=6)
- root.mainloop()
- def askForHelp():
- def datasave(event):
- fo = open("details.xls", "a+")
- fo.write("Teacher Name is:- "+str(v.get())+"\n"+"Student Message is :- "+input.get()+"\n");
- fo.close()
- tkMessageBox.showinfo("Successfull","Message Sent")
- top = Tk()
- top.title("Help Access")
- frame = Frame(width=250, height=300, bg="grey", colormap="new")
- frame.pack()
- teacher = Label(top, text="Teacher Name", bg="black", font=("arial", 15), fg="white")
- v = IntVar()
- Radiobutton(top, text="Ryan Tucker", variable=v, value=1).pack()
- Radiobutton(top, text="Katherine Christensen", variable=v, value=2).pack()
- student = Label(top, text="Student's Feedback", bg="black", font=("arial", 15), fg="white")
- student.place(height=50, width=200, x=280, y=240)
- input = Entry(top)
- input.configure(width=40)
- input.pack()
- teacher.pack()
- teacher.place(height=50, width=200, x=0, y=240)
- student.pack()
- b=Button(top,text="Submit",bg="black",fg="white",font=("Arial",12))
- b.place(height="50",width="200")
- b.bind("<Button-1>",datasave)
- b.pack()
- top.mainloop()
- def gradesCalc():
- gpaCalculator = Tk() #Creating a window
- gpaCalculator.title("GPA Calculator")
- gpaCalculator.geometry("400x200+100+200")
- gpaCalculator.configure(background="Light Blue")
- button1=Button(gpaCalculator,text="Grade").grid(row=0)
- button2=Button(gpaCalculator,text="Credits").grid(row=1)
- button3= Button(gpaCalculator,text = "Course Title").grid(row=2)
- button4=Button(gpaCalculator,text = "Number of modules").grid(row=3)
- button5=Button(gpaCalculator,text = "GPA Result").grid(row=4)
- e1=Entry(gpaCalculator)#This will let the user input an entry of their grade
- e2=Entry(gpaCalculator)
- e3=Entry(gpaCalculator)
- e4=Entry(gpaCalculator)
- e5=Entry(gpaCalculator)
- e1.grid(row=0,column=2)
- e2.grid(row=1,column=2)
- e3.grid(row=2,column=2)
- e4.grid(row=3,column=2)
- e5.grid(row=4,column=2)
- #this is the function which will be used to calculate the grade
- ## def grades(gpaCalculator):
- ## print("world")
- ## if grade=='A':
- ## return 4
- ## elif grade=='B':
- ## return 3
- ## elif grade=='C':
- ## return 2
- ## elif grade=='D':
- ## return 1
- ##
- ## gpaCalculator.mainloop()
- def mainMenu(usrName):
- usrNumList = list(usrName)
- main_menu = Tk()
- frame = Frame(main_menu, width = 600, height = 720)
- main_menu.title("Main Menu")
- def qExit():
- qExit = messagebox.askyesno("Exit system", "Do you want to quit")
- if qExit > 0:
- main_menu.destroy()
- return
- if usrNumList[0] == "S":
- #Student mode
- studentClass = ""
- if usrNumList[4] == "3":
- studentClass = "A"
- elif usrNumList[4] == "4":
- studentClass = "B"
- else:
- studentClass = "C"
- txt = "Welcome, " + usrName+ " in class " + studentClass + ", select one of the options to continue"
- labelText = (txt)
- label = Label(main_menu, text = labelText, font = ("Arial", 20))
- label.grid(row = 0, column = 7)
- #spacers
- label2 = Label(main_menu, text = " ", font = ("Arial", 20))
- label2.grid(row = 1, column = 5)
- label3 = Label(main_menu, text = " ", font = ("Arial", 20))
- label3.grid(row = 2, column = 5)
- label4 = Label(main_menu, text = " ", font = ("Arial", 20))
- label4.grid(row = 3, column = 5)
- label5 = Label(main_menu, text = " ", font = ("Arial", 20))
- label5.grid(row = 5, column = 5)
- b1 = Button(main_menu, text = "View courses", font = ("Arial", 12))
- b1.grid(row = 4, column = 3)
- b1.config(height = 3, width = 10)
- b2 = Button(main_menu, text = "Ask for help", font = ("Arial", 12), command = askForHelp)
- b2.grid(row = 4, column = 10)
- b2.config(height = 3, width = 10)
- b3 = Button(main_menu, text = "View\n progress", font = ("Arial", 12), command = gradesCalc)
- b3.grid(row = 6, column = 3)
- b3.config(height = 3, width = 10)
- b4 = Button(main_menu, text = "Log out", font = ("Arial", 12), command = qExit)
- b4.grid(row = 6, column = 10)
- b4.config(height = 3, width = 10)
- else:
- #Teacher mode
- labelText = "Welcome, " + usrName + ", select one of the options to contiue"
- label = Label(main_menu, text = labelText, font = ("Arial", 20))
- label.grid(row = 0, column = 7)
- #spacers
- label2 = Label(main_menu, text = " ", font = ("Arial", 20))
- label2.grid(row = 1, column = 5)
- label3 = Label(main_menu, text = " ", font = ("Arial", 20))
- label3.grid(row = 2, column = 5)
- label4 = Label(main_menu, text = " ", font = ("Arial", 20))
- label4.grid(row = 3, column = 5)
- label5 = Label(main_menu, text = " ", font = ("Arial", 20))
- label5.grid(row = 5, column = 5)
- b1 = Button(main_menu, text = "View results\n progress", font = ("Arial", 12))
- b1.grid(row = 4, column = 3)
- b1.config(height = 3, width = 10)
- b2 = Button(main_menu, text = "View\n Attendance", font = ("Arial", 12))
- b2.grid(row = 4, column = 10)
- b2.config(height = 3, width = 10)
- b3 = Button(main_menu, text = "Class\n Register", font = ("Arial", 12), command = AttendanceResister)
- b3.grid(row = 6, column = 3)
- b3.config(height = 3, width = 10)
- b4 = Button(main_menu, text = "Log out", font = ("Arial", 12), command = qExit)
- b4.grid(row = 6, column = 10)
- b4.config(height = 3, width = 10)
- main_menu.mainloop()
- def main():
- mainMenu("S170300")#Used for testing
- #logMeIn()
- #global logInStatus
- #global usrName
- #if logInStatus == True:
- #mainMenu(usrName)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement