0% found this document useful (0 votes)
14 views10 pages

Student Management

Uploaded by

paikrahitesh2468
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Student Management

Uploaded by

paikrahitesh2468
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Project Report

On
Student Management System

Submitted By:
Jiya Rawat
Class: XII

Submitted To:
Mr. Vikram Singh Rawat
St. Benedict's School, Shivpuri
Certi cate
This is to certify that the project titled "Student Management
System" submitted by Jiya Rawat, a student of Class XII, has
been completed under my guidance and supervision.
The project is a partial ful llment of the requirement for the
Computer Science course, CBSE Class XII.

Teacher's Name: Mr. Vikram Singh Rawat


School: St. Benedict's School, Shivpuri
fi
fi
Table of Contents

1. Objective
2. Tools and Technologies Used
3. Features
4. Python Code
5. Output Screenshots
6. Conclusion

Objective

The objective of this project is to create a simple Student Management System using Python and
CSV as the backend. This project provides features to add, view, update, delete, and search student
records.

Tools and Technologies Used

• Programming Language: Python


• Data Storage: CSV (Comma-Separated Values)
• Editor: VS Code / PyCharm / IDLE

Features

1. Add Student
2. View Students
3. Search Student
4. Delete Student
5. Update Student

Python Code

import csv
import os

def initialize_csv( le_name):


"""Initialize the CSV le with headers if it does not exist."""
if not os.path.exists( le_name):
with open( le_name, mode='w', newline='') as le:
writer = csv.writer( le)
writer.writerow(["Roll Number", "Name", "Class", "Marks"])

def add_student( le_name):


"""Add a new student record to the CSV le."""
roll_number = input("Enter Roll Number: ")
fi
fi
fi
fi
fi
fi
fi
fi
name = input("Enter Name: ")
student_class = input("Enter Class: ")
marks = input("Enter Marks: ")

with open( le_name, mode='a', newline='') as le:


writer = csv.writer( le)
writer.writerow([roll_number, name, student_class, marks])

print("Student record added successfully!\n")

def view_students( le_name):


"""Display all student records from the CSV le."""
try:
with open( le_name, mode='r') as le:
reader = csv.reader( le)
print("\nStudent Records:")
print("----------------------------------------")
for row in reader:
print("\t".join(row))
print("----------------------------------------\n")
except FileNotFoundError:
print("No records found. Please add some students rst.\n")

def search_student( le_name):


"""Search for a student record by roll number."""
roll_number = input("Enter Roll Number to search: ")
found = False

try:
with open( le_name, mode='r') as le:
reader = csv.reader( le)
for row in reader:
if row[0] == roll_number:
print("\nStudent Record Found:")
print("Roll Number: ", row[0])
print("Name: ", row[1])
print("Class: ", row[2])
print("Marks: ", row[3])
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
found = True
break
if not found:
print("\nStudent record not found!\n")
except FileNotFoundError:
print("No records found. Please add some students rst.\n")

def delete_student( le_name):


"""Delete a student record by roll number."""
roll_number = input("Enter Roll Number to delete: ")
rows = []
found = False

try:
with open( le_name, mode='r') as le:
reader = csv.reader( le)
for row in reader:
if row[0] != roll_number:
rows.append(row)
else:
found = True

if found:
with open( le_name, mode='w', newline='') as le:
writer = csv.writer( le)
writer.writerows(rows)
print("\nStudent record deleted successfully!\n")
else:
print("\nStudent record not found!\n")
except FileNotFoundError:
print("No records found. Please add some students rst.\n")

def update_student( le_name):


"""Update a student's record by roll number."""
roll_number = input("Enter Roll Number to update: ")
rows = []
found = False
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
try:
with open( le_name, mode='r') as le:
reader = csv.reader( le)
for row in reader:
if row[0] == roll_number:
print("\nCurrent Details:")
print("Roll Number: ", row[0])
print("Name: ", row[1])
print("Class: ", row[2])
print("Marks: ", row[3])
row[1] = input("Enter new Name: ")
row[2] = input("Enter new Class: ")
row[3] = input("Enter new Marks: ")
found = True
rows.append(row)

if found:
with open( le_name, mode='w', newline='') as le:
writer = csv.writer( le)
writer.writerows(rows)
print("\nStudent record updated successfully!\n")
else:
print("\nStudent record not found!\n")
except FileNotFoundError:
print("No records found. Please add some students rst.\n")

def main():
"""Main function to drive the program."""
le_name = "students.csv"
initialize_csv( le_name)

while True:
print("Student Management System")
print("1. Add Student")
print("2. View Students")
print("3. Search Student")
print("4. Delete Student")
print("5. Update Student")
print("6. Exit")
fi
fi
fi
fi
fi
fi
fi
fi
fi
choice = input("Enter your choice (1-6): ")

if choice == '1':
add_student( le_name)
elif choice == '2':
view_students( le_name)
elif choice == '3':
search_student( le_name)
elif choice == '4':
delete_student( le_name)
elif choice == '5':
update_student( le_name)
elif choice == '6':
print("Exiting the program. Goodbye!")
break
else:
print("Invalid choice. Please try again.\n")

if __name__ == "__main__":
main()

Output Screenshots

Attach screenshots of the following:

1. Adding a Student
fi
fi
fi
fi
fi
2. Viewing Students

3. Searching a Student

4. Deleting a Student

5. Updating a Student
Conclusion

This project demonstrates the ability to perform basic CRUD operations using Python and a CSV
backend. It is simple, ef cient, and user-friendly.

Let me know if you'd like a formatted PDF or Word version of this report!
fi
Bibliography

1. Python Documentation

◦ URL: https://docs.python.org/3/
◦ Description: Of cial Python documentation used for understanding core libraries and
syntax.
2. CSV Module Documentation

◦ URL: https://docs.python.org/3/library/csv.html
◦ Description: Reference for using the csv module to handle CSV le operations.
3. W3Schools - Python Tutorials

◦ URL: https://www.w3schools.com/python/
◦ Description: Tutorials and examples for learning Python programming basics and
advanced concepts.
4. GeeksforGeeks - Python Programming

◦ URL: https://www.geeksforgeeks.org/python-programming-language/
◦ Description: Examples and explanations of Python functionalities relevant to the
project.
5. Stack Over ow

◦ URL: https://stackover ow.com/


◦ Description: Community forum used for solving coding issues and referencing
solutions for CSV and le handling.
6. Programiz - Python CSV Handling

◦ URL: https://www.programiz.com/python-programming/csv
◦ Description: Guide for handling CSV les in Python, including reading, writing, and
updating data.
This bibliography section ensures proper credit to all the resources used during the project
development.
fl
fi
fl
fi
fi
fi

You might also like