Student Management System
Student Management System
KENDRIYA VIDYALAYA
UTTARKASHI
PROJECT REPORT ON
STUDENT MANAGEMENT SYSTEM
ROLL NO : 01, 09
2. KRISHNA POKHRIYAL
CLASS : XII A
TABLE OF CONTENTS [ T O C ]
S.N PAGE
DESCRIPTION
O NO
1 ACKNOWLEDGEMENT 3
2 CERTIFICATE
4
3 INTRODUCTION
5
5 PROPOSED SYSTEM
8
7 CODING
10
8 SAMPLE OUTPUTS
26
9 HARDWARE AND SOFTWARE REQUIREMENTS
28
ACKNOWLEDGEMENT
CERTIFICATE
INTRODUCTION:
# Coding :
Program (student-management-system.py)
import pickle
import time
import os
def set_data():
rollno = int(input('Enter roll number: '))
name = input('Enter name: ')
english = int(input('Enter Marks in English: '))
maths = int(input('Enter Marks in Maths: '))
physics = int(input('Enter Marks in Physics: '))
chemistry = int(input('Enter Marks in Chemistry: '))
cs = int(input('Enter Marks in CS: '))
print()
#create a dictionary
11
student = {}
student['rollno'] = rollno
student['name'] = name
student['english'] = English
student['maths'] = maths
student['physics'] = physics
student['chemistry'] = chemistry
student['cs'] = cs
return student
def display_data(student):
print('\nSTUDENT DETAILS..')
print('Roll Number:', student['rollno'])
print('Name:', student['name'])
print('English:', student['english'])
print('Maths:', student['maths'])
print('Physics:', student['physics'])
print('Chemistry:', student['chemistry'])
print('CS:', student['cs'])
12
def display_data_tabular(student):
print(student['rollno'], student['name'],
student['english'], student['maths'], student['physics'],
student['chemistry'], student['cs'],sep='\t')
def class_result():
#open file in binary mode for reading
try:
infile = open('student.dat', 'rb')
except FileNotFoundError:
print('No record found..')
print('Go to admin menu to create record')
return
def write_record():
#open file in binary mode for writing.
outfile = open('student.dat', 'ab')
while(True):
#serialize the record and writing to file
pickle.dump(set_data(), outfile)
ans = input('Wants to enter more record (y/n)?: ')
if ans in 'nN':
14
break
def read_records():
#open file in binary mode for reading
try:
infile = open('student.dat', 'rb')
except FileNotFoundError:
print('No record found..')
return
display_data(student)
except EOFError:
break
def search_record():
#open file in binary mode for reading
try:
infile = open('student.dat', 'rb')
except FileNotFoundError:
print('No record..')
return
found = False
rollno = int(input('Enter the rollno you want to search: '))
#read to the end of file.
while True:
try:
16
def delete_record():
print('\nDELETE RECORD')
try:
infile = open('student.dat', 'rb')
17
except FileNotFoundError:
print('No record found to delete..')
return
outfile = open("temp.dat","wb")
found = False
except EOFError:
break
if found == False:
print('Record not Found')
print()
else:
print("record found and deleted")
infile.close()
outfile.close()
os.remove("student.dat")
os.rename("temp.dat","student.dat")
def modify_record():
print('\nMODIFY RECORD')
try:
infile = open('student.dat', 'rb')
except FileNotFoundError:
print('No record found to modify..')
return
19
found = False
outfile = open("temp.dat","wb")
rollno = int(input('Enter roll number: '))
while True:
try:
#reading the oject from file
student = pickle.load(infile)
print('Name:',student['name'])
ans=input('Wants to edit(y/n)? ')
if ans in 'yY':
student['name'] = input("Enter the
name ")
print('English marks:',student['english'])
ans=input('Wants to edit(y/n)? ')
if ans in 'yY':
20
student['english'] = int(input("Enter
new marks: "))
print('Maths marks:',student['maths'])
ans=input('Wants to edit(y/n)? ')
if ans in 'yY':
student['maths'] = int(input("Enter
new marks: "))
print('Physics
marks:',student['physics'])
ans=input('Wants to edit(y/n)? ')
if ans in 'yY':
student['physics'] =
int(input("Enter new marks: "))
print('Chemistry
marks:',student['chemistry'])
ans=input('Wants to edit(y/n)? ')
if ans in 'yY':
21
student['chemistry'] =
int(input("Enter new marks: "))
print('CS marks:',student['cs'])
ans=input('Wants to edit(y/n)? ')
if ans in 'yY':
student['cs'] = int(input("Enter
new marks: "))
pickle.dump(student,outfile)
found = True
break
else
pickle.dump(student,outfile)
except EOFError:
break
if found == False:
print('Record not Found')
else:
print('Record updated')
display_data(student)
22
infile.close()
outfile.close()
os.remove("student.dat")
os.rename("temp.dat","student.dat")
def intro():
print("=x=x=x=x=x=x=x=x=x=x=x=x=x=")
print("STUDENT")
print("REPORT CARD")
print("PROJECT")
print("MADE BY : YOUR NAME")
print("SCHOOL : SCHOOL NAME")
print("=x=x=x=x=x=x=x=x=x=x=x=x=x=")
print()
time.sleep(1)
def main_menu():
print("MAIN MENU")
print("1. REPORT MENU")
print("2. ADMIN MENU")
23
print("3. EXIT")
def report_menu():
print("REPORT MENU")
print("1. CLASS RESULT")
print("2. STUDENT REPORT CARD")
print("3. BACK TO MAIN MENU")
def admin_menu():
print("ADMIN MENU")
print("1. CREATE STUDENT RECORD")
print("2. DISPLAY ALL STUDENTS RECORDS")
print("3. SEARCH STUDENT RECORD ")
print("4. MODIFY STUDENT RECORD ")
print("5. DELETE STUDENT RECORD ")
print("6. BACK TO MAIN MENU")
def main():
intro()
while(True):
24
main_menu()
choice = input('Enter choice(1-3): ')
print()
if choice == '1':
report_menu()
rchoice = input('Enter choice(1-4): ')
if rchoice == '1':
class_result()
elif rchoice == '2':
search_record()
elif rchoice == '3':
pass
else:
print('Invalid input !!!')
print()
if echoice == '1':
write_record()
elif echoice == '2':
read_records()
elif echoice == '3':
search_record()
elif echoice == '4':
modify_record()
elif echoice == '5':
delete_record()
elif echoice == '6':
pass
else:
print('Invalid input !!!')
print()
elif choice == '3':
break
else:
print('Invalid input!!!')
print()
26
#Sample Output:
=x=x=x=x=x=x=x=x=x=x=x=x=x=
STUDENT
REPORT CARD
PROJECT
MADE BY: YOUR NAME
SCHOOL: SCHOOL NAME
=x=x=x=x=x=x=x=x=x=x=x=x=x=
MAIN MENU
1. REPORT MENU
2. ADMIN MENU
3. EXIT
Enter choice (1-3): 1
REPORT MENU
1. CLASS RESULT
2. STUDENT REPORT CARD
3. BACK TO MAIN MENU
27
MAIN MENU
1. REPORT MENU
2. ADMIN MENU
3. EXIT
Enter choice (1-3): 2
ADMIN MENU
1. CREATE STUDENT RECORD
2. DISPLAY ALL STUDENTS RECORDS
3. SEARCH STUDENT RECORD
4. MODIFY STUDENT RECORD
5. DELETE STUDENT RECORD
6. BACK TO MAIN MENU
Enter choice (1-6):
28
REQUIREMENTS:-
# Hardware required:
Printer: to print the required documents of the
project.
Compact Drive.
Processor: Pentium III or above.
Ram: 64 or above.
Hardisk: 20 GB or above.
#Software used:
Operating system: windows 7 ultimate.
References and
Bibliography: