School Management System in Python with Free Source Code

School Management System in Python

Managing a school’s administrative tasks can be a daunting process. Whether it’s handling student data, managing staff, tracking performance, or organizing classes, there are a myriad of operations that need to run smoothly. A School Management System (SMS) can greatly streamline these processes, allowing schools to focus more on the quality of education rather than getting tangled in paperwork. In this post, we will explore the creation of a School Management System in Python with source code, along with a detailed breakdown of its features.

Key Features

  • Student Data Management:
  • Add, view, update, and delete student information.
  • Store details like name, roll number, grade, and attendance.
  • Teacher Information Management:
  • Maintain a detailed record of teachers.
  • Include functionalities for adding, modifying, and removing teacher data.
  • Class Management:
  • Assign students and teachers to different classes.
  • Observe subject allocations and class scheduling.
  • Attendance Tracking:
  • Mark student attendance.
  • Generate attendance reports.
  • Grades and Performance:
  • Store and manage student grades for different subjects.
  • Calculate total grades and generate report cards.
  • User Authentication:
  • Admin login system to secure the platform.
  • Only authorized users can access or modify the system data.

    Interview Question :-Click Here

    Step-by-Step Guide

    Step 1: Setting Up the Project :If you haven’t already, start by installing Python on your PC. It is available for download on the official Python website. Once installed, create a new project folder.
    Step 2: Install Required Libraries :For this project, you will need libraries like sqlite3 for database management, tkinter for creating the GUI (Graphical User Interface), and datetime for handling date and time functionality. Install these libraries by running:

    pip install tk

    Step 3: Database Design :We will use SQLite for storing the data. Here is how to create a simple database structure to store student and teacher information:

    See also  Rental Management System in Java with Source Code

    Download New Real Time Projects :-Click here

    import sqlite3
    
    # Connect to SQLite database
    conn = sqlite3.connect('school_management.db')
    cursor = conn.cursor()
    
    # Create tables for students, teachers, and classes
    cursor.execute('''CREATE TABLE IF NOT EXISTS students (
                      id INTEGER PRIMARY KEY AUTOINCREMENT,
                      name TEXT NOT NULL,
                      grade TEXT NOT NULL,
                      roll_no INTEGER UNIQUE,
                      attendance INTEGER)''')
    
    cursor.execute('''CREATE TABLE IF NOT EXISTS teachers (
                      id INTEGER PRIMARY KEY AUTOINCREMENT,
                      name TEXT NOT NULL,
                      subject TEXT NOT NULL)''')
    
    cursor.execute('''CREATE TABLE IF NOT EXISTS classes (
                      id INTEGER PRIMARY KEY AUTOINCREMENT,
                      class_name TEXT NOT NULL,
                      teacher_id INTEGER,
                      FOREIGN KEY (teacher_id) REFERENCES teachers(id))''')
    
    conn.commit()
    conn.close()

    Step 4: Create the GUI :Using tkinter, we can create an easy-to-use interface. First, let’s construct the primary window:

    https://updategadh.com/category/php-project

    from tkinter import *
    from tkinter import messagebox
    
    root = Tk()
    root.title("School Management System")
    
    # Set window dimensions
    root.geometry("600x400")
    
    # Main Label
    label = Label(root, text="Welcome to the School Management System", font=("Arial", 18))
    label.pack(pady=20)
    
    # Create Buttons for Different Features
    btn_add_student = Button(root, text="Add Student", width=20, command=lambda: add_student())
    btn_add_student.pack(pady=5)
    
    btn_add_teacher = Button(root, text="Add Teacher", width=20, command=lambda: add_teacher())
    btn_add_teacher.pack(pady=5)
    
    root.mainloop()

    Step 5: Implement the Core Features Now, we can add the functionalities for adding and managing student and teacher information. Here’s how to put a basic function to add students into practice:

    def add_student():
        add_window = Toplevel(root)
        add_window.title("Add Student")
    
        # Labels and Entries for Student Data
        lbl_name = Label(add_window, text="Name")
        lbl_name.pack()
        entry_name = Entry(add_window)
        entry_name.pack()
    
        lbl_grade = Label(add_window, text="Grade")
        lbl_grade.pack()
        entry_grade = Entry(add_window)
        entry_grade.pack()
    
        lbl_roll_no = Label(add_window, text="Roll Number")
        lbl_roll_no.pack()
        entry_roll_no = Entry(add_window)
        entry_roll_no.pack()
    
        def save_student():
            name = entry_name.get()
            grade = entry_grade.get()
            roll_no = entry_roll_no.get()
    
            conn = sqlite3.connect('school_management.db')
            cursor = conn.cursor()
    
            try:
                cursor.execute("INSERT INTO students (name, grade, roll_no) VALUES (?, ?, ?)",
                               (name, grade, roll_no))
                conn.commit()
                messagebox.showinfo("Success", "Student added successfully!")
            except Exception as e:
                messagebox.showerror("Error", str(e))
            finally:
                conn.close()
    
        # Save Button
        btn_save = Button(add_window, text="Save", command=save_student)
        btn_save.pack()
    
    # Add similar functionality for teachers, classes, and attendance

    Key Functionalities:

    1. Add Student – Opens a new window where you can enter student details (name, grade, and roll number).
    2. Add Teacher – Opens a new window where you can enter teacher details (name and subject).
    3. View Students – Displays all students in the database with their details.
    4. View Teachers – Displays all teachers in the database with their details.
    See also  Create a Snake Game in Java

    Steps to Run:

    • The GUI will open, allowing you to interact with the School Management System.
    • Install Python and make sure you have tkinter and sqlite3 installed (they usually come pre-installed with Python).
    • Copy and paste this code into a Python file (e.g., school_management.py).
    • Run the script in your terminal or IDE.

    school management system in python project pdf
    school management system in python with source code

    Post Comment