CODING
CODING
Shyamali
Project Report
on
STUDENT MANAGEMENT SYSTEM
This is to certify that BHAVYA JHA, of class XII ‘D’ JAWAHAR VIDYA MANDIR,
RANCHI has done project on ‘STUDENT MANAGEMENT SYSTEM’ under the
supervision of Mrs. Tanuja Sataindra.
I have taken interest and have shown at most sincerity in completion of this
project. I certify this project to our expectation and as per guidelines issued by
CBSE, NEW DELHI.
Hardware
PC
Mobile Phone
Software
Python(latest version)
CODING
import pickle
import time
import os
def set_data():
print()
#create a dictionary
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('Name:', student['name'])
print('English:', student['english'])
print('Maths:', student['maths'])
print('Physics:', student['physics'])
print('Chemistry:', student['chemistry'])
print('CS:', student['cs'])
def display_data_tabular(student):
print('{0:<8}{1:<20}{2:<10}{3:<10}{4:<10}{5:<10}{6:<10}'.format(student['rollno'],
student['chemistry'],student['cs']))
def class_result():
try:
except FileNotFoundError:
return
while True:
try:
student = pickle.load(infile)
#display the record
display_data_tabular(student)
except EOFError:
break
infile.close()
def write_record():
while(True):
pickle.dump(set_data(), outfile)
if ans in 'nN':
break
outfile.close()
def read_records():
try:
except FileNotFoundError:
return
#read to the end of file.
while True:
try:
student = pickle.load(infile)
display_data(student)
except EOFError:
break
infile.close()
def search_record():
try:
except FileNotFoundError:
print('No record..')
return
found = False
print('SEARCH RECORD')
while True:
try:
student = pickle.load(infile)
if student['rollno'] == rollno:
#display the record
display_data(student)
found = True
break
except EOFError:
break
if found==False:
infile.close()
def delete_record():
print('DELETE RECORD')
try:
except FileNotFoundError:
return
outfile = open("temp.dat","wb")
found = False
while True:
try:
student = pickle.load(infile)
display_data(student)
found = True
break
else:
pickle.dump(student,outfile)
except EOFError:
break
if found == False:
print()
else:
infile.close()
outfile.close()
os.remove("student.dat")
os.rename("temp.dat","student.dat")
def modify_record():
print('\nMODIFY RECORD')
try:
except FileNotFoundError:
return
found = False
outfile = open("temp.dat","wb")
while True:
try:
student = pickle.load(infile)
if student['rollno'] == rollno:
print('Name:',student['name'])
if ans in 'yY':
print('English marks:',student['english'])
if ans in 'yY':
print('Maths marks:',student['maths'])
if ans in 'yY':
print('Physics marks:',student['physics'])
if ans in 'yY':
print('Chemistry marks:',student['chemistry'])
if ans in 'yY':
if ans in 'yY':
pickle.dump(student,outfile)
found = True
break
else:
pickle.dump(student,outfile)
except EOFError:
break
if found == False:
else:
print('Record updated')
display_data(student)
infile.close()
outfile.close()
os.remove("student.dat")
os.rename("temp.dat","student.dat")
def intro():
print("="*80)
print("{: ^80s}".format("STUDENT"))
print("{: ^80s}".format("PROJECT"))
print("="*80)
print()
def main_menu():
time.sleep(1)
print("MAIN MENU")
print("3. EXIT")
def report_menu():
time.sleep(1)
print("REPORT MENU")
def admin_menu():
time.sleep(1)
print("\nADMIN MENU")
def main():
intro()
while(True):
main_menu()
if choice == '1':
while True:
report_menu()
print()
if rchoice == '1':
class_result()
search_record()
break
else:
print()
while True:
admin_menu()
print()
if echoice == '1':
write_record()
read_records()
search_record()
modify_record()
break
else:
break
else:
print('Invalid input!!!')
print()
main()
Output
================================================================================
STUDENT
REPORT CARD
PROJECT
MADE BY: Bhavya Jha
================================================================================
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
Enter choice(1-3): 3
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): 1