

{"id":101008,"date":"2021-10-01T09:00:10","date_gmt":"2021-10-01T03:30:10","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=101008"},"modified":"2026-06-01T12:59:50","modified_gmt":"2026-06-01T07:29:50","slug":"python-school-students-management-system","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/","title":{"rendered":"School Management System Project in Python"},"content":{"rendered":"<p>In this Python project, we will build a GUI-based School Management System using the Tkinter, SQLite3, and TkCalender libraries and messagebox and Ttk modules of the Tkinter library. It is an intermediate level project, where you will learn how to use databases and make some great GUIs in Python and apply them in real life. Let\u2019s start!\ud83d\ude0a<\/p>\n<h3>About School Management Systems:<\/h3>\n<p>School Management Systems manage all the information of the students and\/or faculty in a particular school.<br \/>\nIn our project, we will only use it to manage some basic personal information of the students of a school.<\/p>\n<h3>About the project:<\/h3>\n<p>The objective of this is to create a GUI based School Management System. To build this, you will need intermediate understanding of Tkinter library and SQLite API and basic understanding of TkCalender, Datetime libraries, messagebox and Ttk modules.<\/p>\n<h3>Project Prerequisites:<\/h3>\n<p>To build this project, we will need the following libraries:<\/p>\n<p><strong>1. Tkinter<\/strong> &#8211; To create the GUI.<br \/>\n<strong>2. SQLite3<\/strong> &#8211; To connect the program to the database and store information in it.<br \/>\n<strong>3. TkCalender<\/strong> &#8211; To get the user to enter a date.<br \/>\n<strong>4. Datetime.date<\/strong> &#8211; To convert the date from the tree to a Datetime.date instance so that it can be set in.<br \/>\n<strong>5. Tkinter.messagebox<\/strong> &#8211; To show a display box, displaying some information or an error.<br \/>\n<strong>6. Tkinter.ttk<\/strong> &#8211; To create the tree where all the information will be displayed.<\/p>\n<p>The TkCalender library and SQLite API do not come pre-installed with Python. So you will need to run the following command in your command terminal to install them:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">python -m pip install sqlite tkcalender\r\n<\/pre>\n<h3>Download School Management System Project<\/h3>\n<p>Please download the source code of python school students management system project: <a href=\"https:\/\/drive.google.com\/file\/d\/1anYSqPgjLmDEuzB4V5xqLZdBq7j7vBTx\/view?usp=drive_link\"><strong>Python School Management System Project Code<\/strong><\/a><\/p>\n<h3>Project File Structure:<\/h3>\n<p>Here are the steps you will need to execute to build this project:<br \/>\n1. Importing all the necessary libraries and modules.<br \/>\n2. Initializing the GUI window and placing the components in it.<br \/>\n3. Defining the functions to manipulate the data in the database and the tree.<\/p>\n<p>Let\u2019s take a closer look at these steps:<\/p>\n<h4>1. Importing all the necessary libraries and modules:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import datetime\r\nfrom tkinter import *\r\nimport tkinter.messagebox as mb\r\nfrom tkinter import ttk\r\nfrom tkcalendar import DateEntry\r\nimport sqlite3\r\n<\/pre>\n<h4>2. Initializing the GUI window and placing the components in it:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># Initializing the GUI window\r\nmain = Tk()\r\nmain.title('DataFlair School Management System')\r\nmain.geometry('1000x600')\r\nmain.resizable(0, 0)\r\n\r\n# Creating the background and foreground color variables\r\nlf_bg = 'MediumSpringGreen' # bg color for the left_frame\r\ncf_bg = 'PaleGreen' # bg color for the center_frame\r\n\r\n# Creating the StringVar or IntVar variables\r\nname_strvar = StringVar()\r\nemail_strvar = StringVar()\r\ncontact_strvar = StringVar()\r\ngender_strvar = StringVar()\r\nstream_strvar = StringVar()\r\n\r\n# Placing the components in the main window\r\nLabel(main, text=\"SCHOOL MANAGEMENT SYSTEM\", font=headlabelfont, bg='SpringGreen').pack(side=TOP, fill=X)\r\n\r\nleft_frame = Frame(main, bg=lf_bg)\r\nleft_frame.place(x=0, y=30, relheight=1, relwidth=0.2)\r\n\r\ncenter_frame = Frame(main, bg=cf_bg)\r\ncenter_frame.place(relx=0.2, y=30, relheight=1, relwidth=0.2)\r\n\r\nright_frame = Frame(main, bg=\"Gray35\")\r\nright_frame.place(relx=0.4, y=30, relheight=1, relwidth=0.6)\r\n\r\n# Placing components in the left frame\r\nLabel(left_frame, text=\"Name\", font=labelfont, bg=lf_bg).place(relx=0.375, rely=0.05)\r\nLabel(left_frame, text=\"Contact Number\", font=labelfont, bg=lf_bg).place(relx=0.175, rely=0.18)\r\nLabel(left_frame, text=\"Email Address\", font=labelfont, bg=lf_bg).place(relx=0.2, rely=0.31)\r\nLabel(left_frame, text=\"Gender\", font=labelfont, bg=lf_bg).place(relx=0.3, rely=0.44)\r\nLabel(left_frame, text=\"Date of Birth (DOB)\", font=labelfont, bg=lf_bg).place(relx=0.1, rely=0.57)\r\nLabel(left_frame, text=\"Stream\", font=labelfont, bg=lf_bg).place(relx=0.3, rely=0.7)\r\n\r\nEntry(left_frame, width=19, textvariable=name_strvar, font=entryfont).place(x=20, rely=0.1)\r\nEntry(left_frame, width=19, textvariable=contact_strvar, font=entryfont).place(x=20, rely=0.23)\r\nEntry(left_frame, width=19, textvariable=email_strvar, font=entryfont).place(x=20, rely=0.36)\r\nEntry(left_frame, width=19, textvariable=stream_strvar, font=entryfont).place(x=20, rely=0.75)\r\n\r\nOptionMenu(left_frame, gender_strvar, 'Male', \"Female\").place(x=45, rely=0.49, relwidth=0.5)\r\n\r\ndob = DateEntry(left_frame, font=(\"Arial\", 12), width=15)\r\ndob.place(x=20, rely=0.62)\r\n\r\nButton(left_frame, text='Submit and Add Record', font=labelfont, command=add_record, width=18).place(relx=0.025, rely=0.85)\r\n\r\n# Placing components in the center frame\r\nButton(center_frame, text='Delete Record', font=labelfont, command=remove_record, width=15).place(relx=0.1, rely=0.35)\r\nButton(center_frame, text='View Record', font=labelfont, command=view_record, width=15).place(relx=0.1, rely=0.45)\r\nButton(center_frame, text='Reset Fields', font=labelfont, command=reset_fields, width=15).place(relx=0.1, rely=0.55)\r\n\r\n# Placing components in the right frame\r\nLabel(right_frame, text='Students Records', font=headlabelfont, bg='DarkGreen', fg='LightCyan').pack(side=TOP, fill=X)\r\n\r\ntree = ttk.Treeview(right_frame, height=100, selectmode=BROWSE,\r\n                   columns=('Student ID', \"Name\", \"Email Address\", \"Contact Number\", \"Gender\", \"Date of Birth\", \"Stream\"))\r\n\r\nX_scroller = Scrollbar(tree, orient=HORIZONTAL, command=tree.xview)\r\nY_scroller = Scrollbar(tree, orient=VERTICAL, command=tree.yview)\r\n\r\nX_scroller.pack(side=BOTTOM, fill=X)\r\nY_scroller.pack(side=RIGHT, fill=Y)\r\n\r\ntree.config(yscrollcommand=Y_scroller.set, xscrollcommand=X_scroller.set)\r\n\r\ntree.heading('Student ID', text='ID', anchor=CENTER)\r\ntree.heading('Name', text='Name', anchor=CENTER)\r\ntree.heading('Email Address', text='Email ID', anchor=CENTER)\r\ntree.heading('Contact Number', text='Phone No', anchor=CENTER)\r\ntree.heading('Gender', text='Gender', anchor=CENTER)\r\ntree.heading('Date of Birth', text='DOB', anchor=CENTER)\r\ntree.heading('Stream', text='Stream', anchor=CENTER)\r\n\r\ntree.column('#0', width=0, stretch=NO)\r\ntree.column('#1', width=40, stretch=NO)\r\ntree.column('#2', width=140, stretch=NO)\r\ntree.column('#3', width=200, stretch=NO)\r\ntree.column('#4', width=80, stretch=NO)\r\ntree.column('#5', width=80, stretch=NO)\r\ntree.column('#6', width=80, stretch=NO)\r\ntree.column('#7', width=150, stretch=NO)\r\n\r\ntree.place(y=30, relwidth=1, relheight=0.9, relx=0)\r\n\r\ndisplay_records()\r\n<\/pre>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>In this step, we will create the GUI for our project.<\/li>\n<li>We will start by defining the window and its attributes, packing the head label to the top and dividing the rest of the window in 3, as Frames.<\/li>\n<li>In the left frame, we have the Labels and Entry fields and DateEntry fields where the user will enter the data of the new record and a button at the bottom which adds the record to the database.\n<ul>\n<li>The Label widgets denote what to enter in the next field.<\/li>\n<li>The Entry fields, which will be manipulated by StringVar or IntVar variables will take the input from the user.<\/li>\n<li>The DateEntry field will get a date from the user in the MM\/DD\/YY format. Since this field is not manipulated by another one, the functions to change the data in this field will be different from the ones used to change data in normal entry fields.<\/li>\n<\/ul>\n<\/li>\n<li>In the center frame, there are all the buttons to perform certain actions on the fields in the left frame and\/or records in the database.<\/li>\n<li>The right frame contains a label on the top of the frame, followed by a Tree (Table) with columns ID, Name, Email address, Contact number, Date of Birth, Gender and Stream (if student) which has two scrollbars, controlling the vertical and horizontal orientations of the said table.\n<ul>\n<li>The column names of the table are defined when creating the Treeview instance.<\/li>\n<li>After creating the tree variable, we will set 2 Scrollbar objects to control the horizontal and vertical views of the table.<\/li>\n<li>Then, we will decide the text that will be displayed on the table\u2019s first row as column headers and we will decide how much space we need to give to all those columns.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>3. Defining the functions to manipulate the data in the database and the tree:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># Connecting to the Database where all information will be stored\r\nconnector = sqlite3.connect('SchoolManagement.db')\r\ncursor = connector.cursor()\r\n\r\nconnector.execute(\r\n\"CREATE TABLE IF NOT EXISTS SCHOOL_MANAGEMENT (STUDENT_ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, NAME TEXT, EMAIL TEXT, PHONE_NO TEXT, GENDER TEXT, DOB TEXT, STREAM TEXT)\"\r\n)\r\n\r\n# Creating the functions\r\ndef reset_fields():\r\n   global name_strvar, email_strvar, contact_strvar, gender_strvar, dob, stream_strvar\r\n\r\n   for i in ['name_strvar', 'email_strvar', 'contact_strvar', 'gender_strvar', 'stream_strvar']:\r\n       exec(f\"{i}.set('')\")\r\n   dob.set_date(datetime.datetime.now().date())\r\n\r\n\r\ndef reset_form():\r\n   global tree\r\n   tree.delete(*tree.get_children())\r\n\r\n   connector.execute('DELETE FROM SCHOOL_MANAGEMENT')\r\n   connector.commit()\r\n\r\n   reset_fields()\r\n\r\n\r\ndef display_records():\r\n   tree.delete(*tree.get_children())\r\n\r\n   curr = connector.execute('SELECT * FROM SCHOOL_MANAGEMENT')\r\n   data = curr.fetchall()\r\n\r\n   for records in data:\r\n       tree.insert('', END, values=records)\r\n\r\n\r\ndef add_record():\r\n   global name_strvar, email_strvar, contact_strvar, gender_strvar, dob, stream_strvar\r\n\r\n   name = name_strvar.get()\r\n   email = email_strvar.get()\r\n   contact = contact_strvar.get()\r\n   gender = gender_strvar.get()\r\n   DOB = dob.get_date()\r\n   stream = stream_strvar.get()\r\n\r\n   if not name or not email or not contact or not gender or not DOB or not stream:\r\n       mb.showerror('Error!', \"Please fill all the missing fields!!\")\r\n   else:\r\n       try:\r\n           connector.execute(\r\n           'INSERT INTO SCHOOL_MANAGEMENT (NAME, EMAIL, PHONE_NO, GENDER, DOB, STREAM) VALUES (?,?,?,?,?,?)', (name, email, contact, gender, DOB, stream)\r\n           )\r\n           connector.commit()\r\n           mb.showinfo('Record added', f\"Record of {name} was successfully added\")\r\n           reset_fields()\r\n           display_records()\r\n       except:\r\n           mb.showerror('Wrong type', 'The type of the values entered is not accurate. Pls note that the contact field can only contain numbers')\r\n\r\n\r\ndef remove_record():\r\n   if not tree.selection():\r\n       mb.showerror('Error!', 'Please select an item from the database')\r\n   else:\r\n       current_item = tree.focus()\r\n       values = tree.item(current_item)\r\n       selection = values[\"values\"]\r\n\r\n       tree.delete(current_item)\r\n\r\n       connector.execute('DELETE FROM SCHOOL_MANAGEMENT WHERE STUDENT_ID=%d' % selection[0])\r\n       connector.commit()\r\n\r\n       mb.showinfo('Done', 'The record you wanted deleted was successfully deleted.')\r\n\r\n       display_records()\r\n\r\n\r\ndef view_record():\r\n   global name_strvar, email_strvar, contact_strvar, gender_strvar, dob, stream_strvar\r\n\r\n   current_item = tree.focus()\r\n   values = tree.item(current_item)\r\n   selection = values[\"values\"]\r\n\r\n   date = datetime.date(int(selection[5][:4]), int(selection[5][5:7]), int(selection[5][8:]))\r\n\r\n   name_strvar.set(selection[1]); email_strvar.set(selection[2])\r\n   contact_strvar.set(selection[3]); gender_strvar.set(selection[4])\r\n   dob.set_date(date); stream_strvar.set(selection[6])\r\n<\/pre>\n<p><strong>Explanation:<\/strong><\/p>\n<ul>\n<li>We will start off this step by creating a connector instance for the SQLite API. This will perform all operations on our database and a cursor instance.<\/li>\n<li>Then we will define the <em><strong>reset_fields()<\/strong><\/em> function, which will take all StringVar and IntVar variables which we will set to blank using their .set() method whereas we will use the .set_date() method of the DateEntry instance and to set it to the current date that we will get using the <strong>datetime.datetime.now().date()<\/strong> function.<\/li>\n<li>Next, in the <em><strong>reset_form()<\/strong><\/em> function, we will delete all the children (contents) from the Treeview instance and delete everything from the table using the connector\u2019s .execute() and .commit() methods.<\/li>\n<li>After that, in the <strong><em>display_records()<\/em><\/strong> function, we will delete everything from the table where all information will be displayed using the<strong> tree.delete(*tree.get_children())<\/strong> statement. Then we will have the connector execute the select all statement and fetch all the data from there. After that, we will take every shred of that data and keep on inserting them in the table using the .insert() method.<\/li>\n<li>In the <em><strong>add_record()<\/strong><\/em> function, we will get the data from all the StringVar and IntVar instances using their .set() method and from the DateEntry instance using its .get_date() method. If all those are full, we can move forward to adding it to the database using the INSERT command and using the display_records() function.<\/li>\n<li>In the <strong><em>remove_record()<\/em><\/strong> function, if there is no selection in the tree, then we will raise an error message and if there is a selection, we will get the contents of the selection and remove them from the tree and the database.<\/li>\n<li>In the <strong><em>view_record()<\/em><\/strong> function, we will get the values of the current selection in the table and then set the StringVar, IntVar, and DateEntry instances to the respective values.<\/li>\n<\/ul>\n<p><strong>Explanation of code lines:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">current_item_selected = tree.focus()\r\nvalues_in_selected_item = tree.item(current_item_selected)\r\nselection = values_in_selected_item['values']\r\n<\/pre>\n<ul>\n<li><strong>tree.focus()<\/strong> &#8211; Gets the current selected item in the Treeview instance.<\/li>\n<li><strong>tree.item(current_selected_item)<\/strong> &#8211; This takes the tree.focus() item as an argument and it returns all the values of it in the form of tuple.<\/li>\n<li><strong>values_in_selected_item[\u2018values\u2019]<\/strong> &#8211; This returns all the values of tree.focus()<\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">date = datetime.date(int(selection[5][:4]), int(selection[5][5:7]), int(selection[5][8:]))\r\ndob.set_date(date)\r\n<\/pre>\n<ul>\n<li><strong>selection[5]<\/strong> &#8211; This corresponds with the DoB of the student\/teacher in the format: \u201cYYYY-MM-DD\u201d<\/li>\n<li>In this first line, we remove all the hyphens in the DoB and convert all the resulting strings into integers.<\/li>\n<li>When using the .set_date() method of the DateEntry instance, the argument must be a instance of datetime.datetime in the format of \u201cYYYY-MM-DD\u201d and that is what we are doing in the first line and we are setting the date in the DateEntry in the second line.<\/li>\n<\/ul>\n<h4>The final code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import datetime\r\nfrom tkinter import *\r\nimport tkinter.messagebox as mb\r\nfrom tkinter import ttk\r\nfrom tkcalendar import DateEntry  # pip install tkcalendar\r\nimport sqlite3\r\n\r\n# Creating the universal font variables\r\nheadlabelfont = (\"Noto Sans CJK TC\", 15, 'bold')\r\nlabelfont = ('Garamond', 14)\r\nentryfont = ('Garamond', 12)\r\n\r\n# Connecting to the Database where all information will be stored\r\nconnector = sqlite3.connect('SchoolManagement.db')\r\ncursor = connector.cursor()\r\n\r\nconnector.execute(\r\n\"CREATE TABLE IF NOT EXISTS SCHOOL_MANAGEMENT (STUDENT_ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, NAME TEXT, EMAIL TEXT, PHONE_NO TEXT, GENDER TEXT, DOB TEXT, STREAM TEXT)\"\r\n)\r\n\r\n# Creating the functions\r\ndef reset_fields():\r\n   global name_strvar, email_strvar, contact_strvar, gender_strvar, dob, stream_strvar\r\n\r\n   for i in ['name_strvar', 'email_strvar', 'contact_strvar', 'gender_strvar', 'stream_strvar']:\r\n       exec(f\"{i}.set('')\")\r\n   dob.set_date(datetime.datetime.now().date())\r\n\r\n\r\ndef reset_form():\r\n   global tree\r\n   tree.delete(*tree.get_children())\r\n\r\n   reset_fields()\r\n\r\n\r\ndef display_records():\r\n   tree.delete(*tree.get_children())\r\n\r\n   curr = connector.execute('SELECT * FROM SCHOOL_MANAGEMENT')\r\n   data = curr.fetchall()\r\n\r\n   for records in data:\r\n       tree.insert('', END, values=records)\r\n\r\n\r\ndef add_record():\r\n   global name_strvar, email_strvar, contact_strvar, gender_strvar, dob, stream_strvar\r\n\r\n   name = name_strvar.get()\r\n   email = email_strvar.get()\r\n   contact = contact_strvar.get()\r\n   gender = gender_strvar.get()\r\n   DOB = dob.get_date()\r\n   stream = stream_strvar.get()\r\n\r\n   if not name or not email or not contact or not gender or not DOB or not stream:\r\n       mb.showerror('Error!', \"Please fill all the missing fields!!\")\r\n   else:\r\n       try:\r\n           connector.execute(\r\n           'INSERT INTO SCHOOL_MANAGEMENT (NAME, EMAIL, PHONE_NO, GENDER, DOB, STREAM) VALUES (?,?,?,?,?,?)', (name, email, contact, gender, DOB, stream)\r\n           )\r\n           connector.commit()\r\n           mb.showinfo('Record added', f\"Record of {name} was successfully added\")\r\n           reset_fields()\r\n           display_records()\r\n       except:\r\n           mb.showerror('Wrong type', 'The type of the values entered is not accurate. Pls note that the contact field can only contain numbers')\r\n\r\n\r\ndef remove_record():\r\n   if not tree.selection():\r\n       mb.showerror('Error!', 'Please select an item from the database')\r\n   else:\r\n       current_item = tree.focus()\r\n       values = tree.item(current_item)\r\n       selection = values[\"values\"]\r\n\r\n       tree.delete(current_item)\r\n\r\n       connector.execute('DELETE FROM SCHOOL_MANAGEMENT WHERE STUDENT_ID=%d' % selection[0])\r\n       connector.commit()\r\n\r\n       mb.showinfo('Done', 'The record you wanted deleted was successfully deleted.')\r\n\r\n       display_records()\r\n\r\n\r\ndef view_record():\r\n   global name_strvar, email_strvar, contact_strvar, gender_strvar, dob, stream_strvar\r\n\r\n   current_item = tree.focus()\r\n   values = tree.item(current_item)\r\n   selection = values[\"values\"]\r\n\r\n   date = datetime.date(int(selection[5][:4]), int(selection[5][5:7]), int(selection[5][8:]))\r\n\r\n   name_strvar.set(selection[1]); email_strvar.set(selection[2])\r\n   contact_strvar.set(selection[3]); gender_strvar.set(selection[4])\r\n   dob.set_date(date); stream_strvar.set(selection[6])\r\n\r\n\r\n# Initializing the GUI window\r\nmain = Tk()\r\nmain.title('DataFlair School Management System')\r\nmain.geometry('1000x600')\r\nmain.resizable(0, 0)\r\n\r\n# Creating the background and foreground color variables\r\nlf_bg = 'MediumSpringGreen' # bg color for the left_frame\r\ncf_bg = 'PaleGreen' # bg color for the center_frame\r\n\r\n# Creating the StringVar or IntVar variables\r\nname_strvar = StringVar()\r\nemail_strvar = StringVar()\r\ncontact_strvar = StringVar()\r\ngender_strvar = StringVar()\r\nstream_strvar = StringVar()\r\n\r\n# Placing the components in the main window\r\nLabel(main, text=\"SCHOOL MANAGEMENT SYSTEM\", font=headlabelfont, bg='SpringGreen').pack(side=TOP, fill=X)\r\n\r\nleft_frame = Frame(main, bg=lf_bg)\r\nleft_frame.place(x=0, y=30, relheight=1, relwidth=0.2)\r\n\r\ncenter_frame = Frame(main, bg=cf_bg)\r\ncenter_frame.place(relx=0.2, y=30, relheight=1, relwidth=0.2)\r\n\r\nright_frame = Frame(main, bg=\"Gray35\")\r\nright_frame.place(relx=0.4, y=30, relheight=1, relwidth=0.6)\r\n\r\n# Placing components in the left frame\r\nLabel(left_frame, text=\"Name\", font=labelfont, bg=lf_bg).place(relx=0.375, rely=0.05)\r\nLabel(left_frame, text=\"Contact Number\", font=labelfont, bg=lf_bg).place(relx=0.175, rely=0.18)\r\nLabel(left_frame, text=\"Email Address\", font=labelfont, bg=lf_bg).place(relx=0.2, rely=0.31)\r\nLabel(left_frame, text=\"Gender\", font=labelfont, bg=lf_bg).place(relx=0.3, rely=0.44)\r\nLabel(left_frame, text=\"Date of Birth (DOB)\", font=labelfont, bg=lf_bg).place(relx=0.1, rely=0.57)\r\nLabel(left_frame, text=\"Stream\", font=labelfont, bg=lf_bg).place(relx=0.3, rely=0.7)\r\n\r\nEntry(left_frame, width=19, textvariable=name_strvar, font=entryfont).place(x=20, rely=0.1)\r\nEntry(left_frame, width=19, textvariable=contact_strvar, font=entryfont).place(x=20, rely=0.23)\r\nEntry(left_frame, width=19, textvariable=email_strvar, font=entryfont).place(x=20, rely=0.36)\r\nEntry(left_frame, width=19, textvariable=stream_strvar, font=entryfont).place(x=20, rely=0.75)\r\n\r\nOptionMenu(left_frame, gender_strvar, 'Male', \"Female\").place(x=45, rely=0.49, relwidth=0.5)\r\n\r\ndob = DateEntry(left_frame, font=(\"Arial\", 12), width=15)\r\ndob.place(x=20, rely=0.62)\r\n\r\nButton(left_frame, text='Submit and Add Record', font=labelfont, command=add_record, width=18).place(relx=0.025, rely=0.85)\r\n\r\n# Placing components in the center frame\r\nButton(center_frame, text='Delete Record', font=labelfont, command=remove_record, width=15).place(relx=0.1, rely=0.25)\r\nButton(center_frame, text='View Record', font=labelfont, command=view_record, width=15).place(relx=0.1, rely=0.35)\r\nButton(center_frame, text='Reset Fields', font=labelfont, command=reset_fields, width=15).place(relx=0.1, rely=0.45)\r\nButton(center_frame, text='Delete database', font=labelfont, command=reset_form, width=15).place(relx=0.1, rely=0.55)\r\n\r\n# Placing components in the right frame\r\nLabel(right_frame, text='Students Records', font=headlabelfont, bg='DarkGreen', fg='LightCyan').pack(side=TOP, fill=X)\r\n\r\ntree = ttk.Treeview(right_frame, height=100, selectmode=BROWSE,\r\n                   columns=('Student ID', \"Name\", \"Email Address\", \"Contact Number\", \"Gender\", \"Date of Birth\", \"Stream\"))\r\n\r\nX_scroller = Scrollbar(tree, orient=HORIZONTAL, command=tree.xview)\r\nY_scroller = Scrollbar(tree, orient=VERTICAL, command=tree.yview)\r\n\r\nX_scroller.pack(side=BOTTOM, fill=X)\r\nY_scroller.pack(side=RIGHT, fill=Y)\r\n\r\ntree.config(yscrollcommand=Y_scroller.set, xscrollcommand=X_scroller.set)\r\n\r\ntree.heading('Student ID', text='ID', anchor=CENTER)\r\ntree.heading('Name', text='Name', anchor=CENTER)\r\ntree.heading('Email Address', text='Email ID', anchor=CENTER)\r\ntree.heading('Contact Number', text='Phone No', anchor=CENTER)\r\ntree.heading('Gender', text='Gender', anchor=CENTER)\r\ntree.heading('Date of Birth', text='DOB', anchor=CENTER)\r\ntree.heading('Stream', text='Stream', anchor=CENTER)\r\n\r\ntree.column('#0', width=0, stretch=NO)\r\ntree.column('#1', width=40, stretch=NO)\r\ntree.column('#2', width=140, stretch=NO)\r\ntree.column('#3', width=200, stretch=NO)\r\ntree.column('#4', width=80, stretch=NO)\r\ntree.column('#5', width=80, stretch=NO)\r\ntree.column('#6', width=80, stretch=NO)\r\ntree.column('#7', width=150, stretch=NO)\r\n\r\ntree.place(y=30, relwidth=1, relheight=0.9, relx=0)\r\n\r\ndisplay_records()\r\n\r\n# Finalizing the GUI window\r\nmain.update()\r\nmain.mainloop()\r\n<\/pre>\n<h3>Python School Management System Output<\/h3>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-school-management-system-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-102015\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-school-management-system-output.png\" alt=\"python school management system output\" width=\"1251\" height=\"790\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-school-management-system-output.png 1251w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-school-management-system-output-768x485.png 768w\" sizes=\"auto, (max-width: 1251px) 100vw, 1251px\" \/><\/a><\/p>\n<h3>Summary:<\/h3>\n<p>Congratulations! You have now created your own School Management System. Tkinter, TkCalender, DateTime libraries, SQLite3 API and messagebox and Ttk modules are useful here.<\/p>\n<p>You can use this project for multiple purposes. It can be for managing the information of the students in your school, the information of teachers, etc.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2574,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1anYSqPgjLmDEuzB4V5xqLZdBq7j7vBTx\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20260601073024\\\/https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1anYSqPgjLmDEuzB4V5xqLZdBq7j7vBTx\\\/view?usp=drive_link&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-06-01 07:56:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-04 13:25:56&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-07 23:00:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-11 04:28:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-14 12:06:48&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-14 12:06:48&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Python project, we will build a GUI-based School Management System using the Tkinter, SQLite3, and TkCalender libraries and messagebox and Ttk modules of the Tkinter library. It is an intermediate level project,&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":102014,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[21082,25316,25319,25317,25318],"class_list":["post-101008","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python-project","tag-python-school-management-system","tag-python-tkinter-project","tag-school-management-system","tag-student-management-system"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>School Management System Project in Python - DataFlair<\/title>\n<meta name=\"description\" content=\"Create your own School Management System using Tkinter, TkCalender, DateTime libraries, SQLite3 API and messagebox and Ttk modules.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"School Management System Project in Python - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Create your own School Management System using Tkinter, TkCalender, DateTime libraries, SQLite3 API and messagebox and Ttk modules.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-01T03:30:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T07:29:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-project-school-management-system.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"School Management System Project in Python - DataFlair","description":"Create your own School Management System using Tkinter, TkCalender, DateTime libraries, SQLite3 API and messagebox and Ttk modules.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/","og_locale":"en_US","og_type":"article","og_title":"School Management System Project in Python - DataFlair","og_description":"Create your own School Management System using Tkinter, TkCalender, DateTime libraries, SQLite3 API and messagebox and Ttk modules.","og_url":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-10-01T03:30:10+00:00","article_modified_time":"2026-06-01T07:29:50+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-project-school-management-system.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"School Management System Project in Python","datePublished":"2021-10-01T03:30:10+00:00","dateModified":"2026-06-01T07:29:50+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/"},"wordCount":1182,"commentCount":6,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-project-school-management-system.jpg","keywords":["Python project","python school management system","python tkinter project","school management system","student management system"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/","url":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/","name":"School Management System Project in Python - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-project-school-management-system.jpg","datePublished":"2021-10-01T03:30:10+00:00","dateModified":"2026-06-01T07:29:50+00:00","description":"Create your own School Management System using Tkinter, TkCalender, DateTime libraries, SQLite3 API and messagebox and Ttk modules.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-project-school-management-system.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/python-project-school-management-system.jpg","width":1200,"height":628,"caption":"python project school management system"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-school-students-management-system\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"School Management System Project in Python"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":false,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/101008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=101008"}],"version-history":[{"count":7,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/101008\/revisions"}],"predecessor-version":[{"id":148656,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/101008\/revisions\/148656"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/102014"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=101008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=101008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=101008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}