Student Management
Student Management
Student Management
Python is a versatile and powerful programming language widely used for various
applications, including web development, data analysis, machine learning, and database
management. MySQL, on the other hand, is an open-source relational database
management system (RDBMS) that uses SQL (Structured Query Language) to interact
with data. Combining Python with MySQL allows developers to create robust
applications for managing and processing data efficiently.
1. Ease of Learning and Use: Python's syntax is clean and readable, making it
accessible for beginners and professionals alike.
2. Reliability: It provides robust data security and recovery features, ensuring data
integrity.
1
ABSTRACT
**Introduction**:
**Objective**:
**Expected Outcome**:
The system will provide a reliable, efficient, and scalable platform for
managing student-related data, benefiting educational institutions
through improved operations and reduced administrative burden.
2
REQUIREMENTS
1. Hardware Requirements
-Processor:
-RAM:
-Storage:
2. Software Requirements
-Python Libraries:
mysql-connector-python`
3. Installation Instructions
3
2. During installation, check **“Add Python to PATH”** and complete
the setup.
2. Complete the setup and configure a new root user with a secure
password.
```bash
```
4
After running the script, the Tkinter GUI will appear with a menu bar.
2. Student Management:
3. Attendance:
4. RANK:
- Add a grade for a student by specifying their ID, subject, and grade.
5. Fees:
- Record fee payments for students with their ID, amount, and date.
6. Exit:
5. Notes
5
Modules and Libraries Used in the Project
1. **Tkinter**
- **Usage**:
- **Usage**:
3. **Datetime**
- **Usage**:
6
4. **Messagebox (from Tkinter)**
- **Usage**:
- **Usage**:
- **Usage**:
Database.
7
Built-in Functions Used in the Project
1. **`str()`**
- **Usage**:
2. **`int()`**
- **Usage**:
- **Reason**: Ensures that IDs are in the correct data type when
used in SQL operations.
3. **`datetime.strptime()`**
- **Usage**:
8
4. **`strptime()`**
- **Usage**:
- Converts user input for the date into a `datetime` object for proper
validation and database compatibility.
5. **`messagebox.showinfo()
- **Usage**:
6. **`messagebox.showerror()`**
- **Usage**:
9
- **Reason**: Provides error feedback to the user for corrective
actions.
7. **`cursor.execute()`**
- **Usage**:
8. **`cursor.fetchall()`**
- **Usage**:
- Used after a `SELECT` query to retrieve all rows returned from the
database.
9. **`cursor.fetchone()`**
10
- **Usage**:
10. **`input()`**
- **Usage**:
11.str.format()
- **Usage**:
11
12. **exit()**
- **Usage**:
- Used to close the application and exit when the user chooses to
quit.
12
SOURCE CODE
import mysql.connector
# Database connection
try:
db_connection = mysql.connector.connect(
host="localhost",
user="root",
password="manish362121",
database="SchoolDB"
cursor = db_connection.cursor()
print(f"Error: {err}")
#CONSISTS OF 9 MENU
13
cursor.execute(query, values)
db_connection.commit()
cursor.execute(query, values)
db_connection.commit()
def delete_student(student_id):
cursor.execute(query, (student_id,))
db_connection.commit()
def view_students():
students = cursor.fetchall()
view_window = Toplevel(root)
text = Text(view_window)
text.pack()
14
for student in students:
def search_student(student_id):
student = cursor.fetchone()
if student:
else:
def add_student_window():
def add_student():
name = entry_name.get()
dob = entry_dob.get()
student_class = entry_class.get()
contact = entry_contact.get()
email = entry_email.get()
try:
15
create_student(name, dob_formatted.strftime("%Y-%m-%d"),
student_class, contact, email)
except ValueError:
add_window = Toplevel(root)
add_window.title("Add Student")
entry_name = Entry(add_window)
entry_name.grid(row=0, column=1)
entry_dob = Entry(add_window)
entry_dob.grid(row=1, column=1)
entry_class = Entry(add_window)
entry_class.grid(row=2, column=1)
entry_contact = Entry(add_window)
entry_contact.grid(row=3, column=1)
entry_email = Entry(add_window)
entry_email.grid(row=4, column=1)
16
def update_student_window():
def update_student_action():
student_id = entry_id.get()
name = entry_name.get()
dob = entry_dob.get()
student_class = entry_class.get()
contact = entry_contact.get()
email = entry_email.get()
try:
except ValueError:
update_window = Toplevel(root)
update_window.title("Update Student")
entry_id = Entry(update_window)
entry_id.grid(row=0, column=1)
entry_name = Entry(update_window)
entry_name.grid(row=1, column=1)
17
entry_dob = Entry(update_window)
entry_dob.grid(row=2, column=1)
entry_class = Entry(update_window)
entry_class.grid(row=3, column=1)
entry_contact = Entry(update_window)
entry_contact.grid(row=4, column=1)
entry_email = Entry(update_window)
entry_email.grid(row=5, column=1)
# Attendance Functionality
cursor.execute(query, values)
db_connection.commit()
def mark_attendance_window():
def mark_attendance_action():
18
student_id = entry_student_id.get()
attendance_date = entry_date.get()
status = entry_status.get()
try:
except ValueError:
attendance_window = Toplevel(root)
attendance_window.title("Mark Attendance")
entry_student_id = Entry(attendance_window)
entry_student_id.grid(row=0, column=1)
entry_date = Entry(attendance_window)
entry_date.grid(row=1, column=1)
Label(attendance_window, text="Status
(Present/Absent)").grid(row=2, column=0)
entry_status = Entry(attendance_window)
entry_status.grid(row=2, column=1)
# Grades Functionality
19
def add_grade(student_id,CLASS, grade):
cursor.execute(query, values)
db_connection.commit()
def add_grade_window():
def add_grade_action():
student_id = entry_student_id.get()
CLASS = entry_CLASS.get()
grade = entry_grade.get()
try:
except ValueError:
grade_window = Toplevel(root)
grade_window.title("Add Grade")
entry_student_id = Entry(grade_window)
entry_student_id.grid(row=0, column=1)
entry_CLASS = Entry(grade_window)
entry_CLASS.grid(row=1, column=1)
20
Label(grade_window, text="RANK").grid(row=2, column=0)
entry_grade = Entry(grade_window)
entry_grade.grid(row=2, column=1)
cursor.execute(query, values)
db_connection.commit()
def add_fee_window():
def add_fee_action():
student_id = entry_student_id.get()
amount = entry_amount.get()
fee_date = entry_fee_date.get()
try:
except ValueError:
fee_window = Toplevel(root)
21
fee_window.title("FEES RECEIPT")
entry_student_id = Entry(fee_window)
entry_student_id.grid(row=0, column=1)
entry_amount = Entry(fee_window)
entry_amount.grid(row=1, column=1)
entry_fee_date = Entry(fee_window)
entry_fee_date.grid(row=2, column=1)
# Exit functionality
def exit_app():
root.quit()
root = Tk()
menu = Menu(root)
root.config(menu=menu)
22
# Define menu options
student_menu.add_command(label="Add Student",
command=add_student_window)
student_menu.add_command(label="Update Student",
command=update_student_window)
student_menu.add_command(label="Delete Student",
command=lambda: delete_student(int(simpledialog.askstring("Delete
Student", "Enter Student ID to delete:"))))
student_menu.add_command(label="View Students",
command=view_students)
student_menu.add_command(label="Search Student",
command=lambda: search_student(int(simpledialog.askstring("Search
Student", "Enter Student ID to search:"))))
menu.add_cascade(label="Attendance", menu=attendance_menu)
attendance_menu.add_command(label="Mark Attendance",
command=mark_attendance_window)
menu.add_cascade(label="rank", menu=grades_menu)
grades_menu.add_command(label="Add rank",
command=add_grade_window)
23
fee_menu.add_command(label="Add Fee PAID",
command=add_fee_window)
menu.add_command(label="Exit", command=exit_app)
root.mainloop()
24
OUTPUT
25
DELETE: deletes student record from records.
26
VIEW: gives us the records of all students.
27
IN THIS VIEW ALL STUDENTS TAB WE CAN CONFIRM THAT THE
DETAILS OF ID:7 HAS ITS DATE OF BIRTH AND PHNO NO UPDATED
28
RANK: assigns the rank to student in their respective classes
29
FEES RECEIPT: it stores the details of student who have
paid the fees.
30
CONCLUSION
Comprehensive Solution: The Student Management System offers a
complete solution for handling essential administrative tasks in
educational institutions.
31
FUTURE OUTLOOK
Future Outlook: Possible Updates for the Student Management System
3. **Email Notifications**:
32
- Link with other school management software (e.g., learning
management systems or academic portals).
8. **Calendar Integration**:
33
REFRENCES
1.https://www.geeksforgeeks.org/python-gui-tkinter/
2.https://www.javatpoint.com/python-tkinter
3.https://stackoverflow.com/questions/40843698/how-to-auto-
activate-a- tkinter-simpledialog-pop-up-window
4.https://www.w3resource.com/python-
exercises/tkinter/python-tkinter-dialogs-and-file-handling-
exercise-1.php
5.https://www.w3schools.com/python/python_mysql_select.asp
34