ALENTL

main.py

Oct 28th, 2022
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.55 KB | None | 0 0
  1. import mysql.connector as mc
  2. from tkinter import *
  3.  
  4. # MySQL Objects and connection string
  5. cnx = mc.connect(host="localhost", user="alen", password="alen", database="school")
  6. cur = cnx.cursor()
  7. cnx.autocommit = True
  8.  
  9. """
  10. Home function is the default home page. It consists of the  login page. It asks the user which group he/she belongs to ie (student, teacher, staff, admin)
  11. """
  12. def home():
  13.     window = Tk()
  14.     window.title("SCHOOL MANAGEMENT SYSTEM")
  15.     window.geometry("960x606")
  16.     window.resizable(0,0)
  17.     window.iconbitmap("./ico/school.ico")
  18.  
  19.     # Creating background image variable
  20.     bg = PhotoImage(file="./img/login.png")
  21.  
  22.     # Creating the background label
  23.     l1 = Label(window, image=bg)
  24.     l1.place(x=0, y=0)
  25.  
  26.     # Creating the login text
  27.     l2 = Label(window, text="LOGIN", font=("times new roman", 20, "bold"), bg="#184800", fg="#ff007f")
  28.     l2.place(x=441, y=23)
  29.  
  30.     # Creating the student button
  31.     l3 = Button(window, text="STUDENT", width=15, font=("times new roman",10, "bold"))
  32.     l3.place(x=435, y=100)
  33.  
  34.     # Creating the teacher button
  35.     l4 = Button(window, text="TEACHER", width=15, font=("times new roman", 10, "bold"))
  36.     l4.place(x=435, y=140)
  37.  
  38.     # Creating the staff button
  39.     l5 = Button(window, text="STAFF", width=15, font=("times new roman", 10, "bold"))
  40.     l5.place(x=435, y=180)
  41.  
  42.     # Creating the admin button
  43.     l6 = Button(window, text="ADMIN", width=15, font=("times new roman",10, "bold"))
  44.     l6.place(x=435, y=220)
  45.  
  46.     window.mainloop()
  47.  
  48. if __name__ == "__main__":
  49.     home()
Advertisement
Add Comment
Please, Sign In to add comment