Advertisement
ALENTL

main.py

Oct 31st, 2022
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.94 KB | None | 0 0
  1. def stud_academics(window):
  2.     window.destroy()
  3.  
  4. #def stud_academics() -> None:
  5.     customtkinter.set_appearance_mode("dark")
  6.     customtkinter.set_default_color_theme("dark-blue")
  7.  
  8.     # Creating text variable for subject, examination
  9.     global sub_var
  10.     global examintaion
  11.  
  12.     # Creating academics window
  13.     saw = customtkinter.CTk()
  14.     saw.geometry("1280x585")
  15.     saw.resizable(0,0)
  16.  
  17.     sub_var = StringVar()
  18.     examination_var = StringVar()
  19.    
  20.     saw.title("STUDENT ACADEMICS")
  21.     saw.iconbitmap("./ico/stud_academics.ico")
  22.  
  23.     # Creating background image variable
  24.     bg = ImageTk.PhotoImage(Image.open("./icons/academics.jpg").resize((1280, 720), Image.Resampling.LANCZOS))
  25.  
  26.     # Creating background image label
  27.     l1 = customtkinter.CTkLabel(master=saw, image=bg, bg_color="black")
  28.     l1.place(x=0, y=0)
  29.  
  30.     # Creating the subject text label
  31.     l2 = customtkinter.CTkLabel(master=saw, text="SUBJECT", text_font=("Consolas", 20, "bold"))
  32.     l2.place(x=1070, y=40)
  33.  
  34.     # Getting student stream from database
  35.     stream = L[6]
  36.  
  37.     # Creating combobox
  38.     cb1 = customtkinter.CTkComboBox(master=saw)
  39.  
  40.     if stream == "computer science":
  41.         cb1["values"] = ["Computer Science", "Maths", "Chemistry", "Physics, English"]
  42.    
  43.     elif stream == "bio maths":
  44.         cb1["values"] = ["Biology", "Maths", "Chemistry", "Physics", "English"]
  45.  
  46.     elif stream == "bio psychology":
  47.         cb1["values"] = ["Biology", "Psychology", "Chemistry", "Physics", "English"]
  48.  
  49.     elif stream == "commerce computer":
  50.         cb1["values"] = ["Commerce", "Bussiness", "Economics", "Accountancy", "Computer Science"]
  51.  
  52.     elif stream == "commerce ip":
  53.         cb1["values"] = ["Commerce", "Bussiness", "Economics", "Accountancy", "IP"]
  54.  
  55.     elif stream == "commerce maths":
  56.         cb1["values"] = ["Commerce", "Bussiness", "Economics", "Accountancy", "Maths"]
  57.  
  58.     cb1.place(x=1070, y=60)
  59.  
  60.     saw.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement