Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector as mc
- from tkinter import *
- # MySQL Objects and connection string
- cnx = mc.connect(host="localhost", user="alen", password="alen", database="school")
- cur = cnx.cursor()
- cnx.autocommit = True
- """
- 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)
- """
- def home():
- window = Tk()
- window.title("SCHOOL MANAGEMENT SYSTEM")
- window.geometry("960x606")
- window.resizable(0,0)
- window.iconbitmap("./ico/school.ico")
- # Creating background image variable
- bg = PhotoImage(file="./img/login.png")
- # Creating the background label
- l1 = Label(window, image=bg)
- l1.place(x=0, y=0)
- # Creating the login text
- l2 = Label(window, text="LOGIN", font=("times new roman", 20, "bold"), bg="#184800", fg="#ff007f")
- l2.place(x=441, y=23)
- # Creating the student button
- l3 = Button(window, text="STUDENT", width=15, font=("times new roman",10, "bold"))
- l3.place(x=435, y=100)
- # Creating the teacher button
- l4 = Button(window, text="TEACHER", width=15, font=("times new roman", 10, "bold"))
- l4.place(x=435, y=140)
- # Creating the staff button
- l5 = Button(window, text="STAFF", width=15, font=("times new roman", 10, "bold"))
- l5.place(x=435, y=180)
- # Creating the admin button
- l6 = Button(window, text="ADMIN", width=15, font=("times new roman",10, "bold"))
- l6.place(x=435, y=220)
- window.mainloop()
- if __name__ == "__main__":
- home()
Advertisement
Add Comment
Please, Sign In to add comment