0% found this document useful (0 votes)
54 views

Computer Project Work Word File

The document contains Python code to create a student record management system. It defines functions to get user input to add student records to a file, display the records stored in the file, and print separator lines. The main program calls the functions to get input, display output, and print lines to manage and view student details stored in a pickle file.

Uploaded by

PREJAN RAJA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Computer Project Work Word File

The document contains Python code to create a student record management system. It defines functions to get user input to add student records to a file, display the records stored in the file, and print separator lines. The main program calls the functions to get input, display output, and print lines to manage and view student details stored in a pickle file.

Uploaded by

PREJAN RAJA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

import pickle

def get_input():

with open("Student_details.dat",'wb') as f:

print("Opened file - Student details")

for i in range(100):

print("-",end="")

print()

choice=""

choice=str(input("Do you want to add details? y/n : "))

while choice=="y" :

ID=int(input("Enter student ID : "))

name=str(input("Enter student name : "))

DOB=int(input("Enter date of birth : "))

gender=str(input("Enter gender : "))

dept=str(input("Enter department : "))

fname=str(input("Enter Father's name : "))

mname=str(input("Enter Mother's name : "))

bg=str(input("Enter Blood Group : "))

aadhar=int(input("Enter Aadhar number : "))

address=str(input("Enter Address : "))

contact=int(input("Enter Phone number : "))

rec=[ID,name,DOB,gender,dept,fname,mname,bg,aadhar,address,contact]

pickle.dump(rec,f)
print("Record inserted successfully.....")

choice=str(input("Do you want to add details? y/n : "))

def display_output():

L1=[]

f1=open("Student_details.dat",'rb')

while True:

try:

data=pickle.load(f1)

print(data)

except EOFError:

break

f1.close()

def line():

for i in range(100):

print("-",end="")

print()

#Main Program

get_input()

line()

display_output()

line()

print("Thank you.......")
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit
(Intel)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

>>>

==== RESTART: C:\Users\David\Desktop\com project\Student details


program.py ====

Opened file - Student details

----------------------------------------------------------------------------------------------------

Do you want to add details? y/n : y

Enter student ID : 12_01

Enter student name : Anish

Enter date of birth : 12_03_2004

Enter gender : Male

Enter department : B,Tech

Enter Father's name : Anand

Enter Mother's name : Asha

Enter Blood Group : B+ve

Enter Aadhar number : 987667899876

Enter Address : A-12, KTC Nagar, Tirunelveli, Tamilnadu

Enter Phone number : 9812763451

Record inserted successfully.....

Do you want to add details? y/n : y

Enter student ID : 12_02

Enter student name : Dina


Enter date of birth : 23_06_2004

Enter gender : Female

Enter department : B.E

Enter Father's name : Ramesh

Enter Mother's name : Reena

Enter Blood Group : O+ve

Enter Aadhar number : 918273645432

Enter Address : B-5, Jayanthi nagar, V.M.Chatram, Tirunelveli, Tamilnadu

Enter Phone number : 9876123451

Record inserted successfully.....

Do you want to add details? y/n : n

----------------------------------------------------------------------------------------------------

[1201, 'Anish', 12032004, 'Male', 'B,Tech', 'Anand', 'Asha', 'B+ve',


987667899876, 'A-12, KTC Nagar, Tirunelveli, Tamilnadu', 9812763451]

[1202, 'Dina', 23062004, 'Female', 'B.E', 'Ramesh', 'Reena', 'O+ve',


918273645432, 'B-5, Jayanthi nagar, V.M.Chatram, Tirunelveli, Tamilnadu',
9876123451]

----------------------------------------------------------------------------------------------------

Thank you.......

>>>
import pickle

def get_input():

with open("Staff_details.dat",'wb') as f:

print("Opened file - Staff details")

for i in range(100):

print("-",end="")

print()

choice=""

choice=str(input("Do you want to add details? y/n : "))

while choice=="y" :

ID=int(input("Enter Staff ID : "))

name=str(input("Enter Staff name : "))

DOB=int(input("Enter date of birth : "))

gender=str(input("Enter gender : "))

dept=str(input("Enter department : "))

q=str(input("Enter qualification : "))

exp=str(input("Enter experience : "))

sal=int(input("Enter salary : "))

bg=str(input("Enter Blood Group : "))

aadhar=int(input("Enter Aadhar number : "))

address=str(input("Enter Address : "))

contact=int(input("Enter Phone number : "))

rec=[ID,name,DOB,gender,dept,q,exp,sal,bg,aadhar,address,contact]
pickle.dump(rec,f)

print("Record inserted successfully.....")

choice=str(input("Do you want to add details? y/n : "))

def display_output():

L1=[]

f1=open("Staff_details.dat",'rb')

while True:

try:

data=pickle.load(f1)

print(data)

except EOFError:

break

f1.close()

def line():

for i in range(100):

print("-",end="")

print()

#Main Program

get_input()

line()

display_output()

line()

print("Thank you.......")
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit
(Intel)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

>>>

===== RESTART: C:/Users/David/Desktop/com project/Staff details program.py


=====

Opened file - Staff details

----------------------------------------------------------------------------------------------------

Do you want to add details? y/n : y

Enter Staff ID : 1_01

Enter Staff name : Ramesh

Enter date of birth : 30_07_1975

Enter gender : Male

Enter department : Physics

Enter qualification : PhD

Enter experience : 10 years

Enter salary : 50000

Enter Blood Group : A+ve

Enter Aadhar number : 99887766554433

Enter Address : D-2, Srinivasa nagar, Tirunelveli, Tamilnadu

Enter Phone number : 9281573645

Record inserted successfully.....

Do you want to add details? y/n : y

Enter Staff ID : 1_02


Enter Staff name : Shanti

Enter date of birth : 31_01_1970

Enter gender : Female

Enter department : Computer science

Enter qualification : PhD

Enter experience : 12 years

Enter salary : 55000

Enter Blood Group : B+ve

Enter Aadhar number : 918273648392

Enter Address : H-09, Gandhi nagar, Tirunelveli, Tamilnadu

Enter Phone number : 9786543213

Record inserted successfully.....

Do you want to add details? y/n : n

----------------------------------------------------------------------------------------------------

[101, 'Ramesh', 30071975, 'Male', 'Physics', 'PhD', '10 years', 50000, 'A+ve',
99887766554433, 'D-2, Srinivasa nagar, Tirunelveli, Tamilnadu', 9281573645]

[102, 'Shanti', 31011970, 'Female', 'Computer science', 'PhD', '12 years', 55000,
'B+ve', 918273648392, 'H-09, Gandhi nagar, Tirunelveli, Tamilnadu',
9786543213]

----------------------------------------------------------------------------------------------------

Thank you.......

>>>
import pickle

def get_input():

with open("Fee_details.dat",'wb') as f:

print("Opened file - Fee details")

for i in range(100):

print("-",end="")

print()

choice=""

choice=str(input("Do you want to add details? y/n : "))

while choice=="y" :

ID=int(input("Enter student ID : "))

name=str(input("Enter student name : "))

dept=str(input("Enter department : "))

t_fee=int(input("Enter Tuition fee : "))

h_fee=int(input("Enter Hostel fee : "))

book_fee=int(input("Enter book fee : "))

pnp=str(input("Paid / unpaid : "))

balance=(int(input("Enter balance : ")))

rec=[ID,name,dept,t_fee,h_fee,book_fee,pnp,balance]

pickle.dump(rec,f)

print("Record inserted successfully.....")

choice=str(input("Do you want to add details? y/n : "))


def display_output():

L1=[]

f1=open("Fee_details.dat",'rb')

while True:

try:

data=pickle.load(f1)

print(data)

except EOFError:

break

f1.close()

def line():

for i in range(100):

print("-",end="")

print()

#Main Program

get_input()

line()

display_output()

line()

print("Thank you.......")
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit
(Intel)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

>>>

====== RESTART: C:/Users/David/Desktop/com project/Fee details program.py


======

Opened file - Fee details

----------------------------------------------------------------------------------------------------

Do you want to add details? y/n : y

Enter student ID : 12_01

Enter student name : Anish

Enter department : B.Tech

Enter Tuition fee : 70000

Enter Hostel fee : 70000

Enter book fee : 10000

Paid / unpaid : Paid

Enter balance : 0

Record inserted successfully.....

Do you want to add details? y/n : y

Enter student ID : 12_02

Enter student name : Dina

Enter department : B.E

Enter Tuition fee : 70000

Enter Hostel fee : 0


Enter book fee : 10000

Paid / unpaid : unpaid

Enter balance : 30000

Record inserted successfully.....

Do you want to add details? y/n : n

----------------------------------------------------------------------------------------------------

[1201, 'Anish', 'B.Tech', 70000, 70000, 10000, 'Paid', 0]

[1202, 'Dina', 'B.E', 70000, 0, 10000, 'unpaid', 30000]

----------------------------------------------------------------------------------------------------

Thank you.......

>>>
import pickle

def get_input():

with open("Admission_details.dat",'wb') as f:

print("Opened file - Admission details")

for i in range(100):

print("-",end="")

print()

choice=""

choice=str(input("Do you want to add details? y/n : "))

while choice=="y" :

ID=int(input("Enter student ID : "))

name=str(input("Enter student name : "))

DOB=int(input("Enter date of birth : "))

gender=str(input("Enter gender : "))

dept=str(input("Enter department : "))

prev_schl=str(input("Enter previous school : "))

board=str(input("Enter board : "))

cut_off=int(input("Enter cut off : "))

contact=int(input("Enter Phone number : "))

rec=[ID,name,DOB,gender,dept,prev_schl,board,cut_off,contact]

pickle.dump(rec,f)

print("Record inserted successfully.....")

choice=str(input("Do you want to add details? y/n : "))


def display_output():

L1=[]

f1=open("Admission_details.dat",'rb')

while True:

try:

data=pickle.load(f1)

print(data)

except EOFError:

break

f1.close()

def line():

for i in range(100):

print("-",end="")

print()

#Main Program

get_input()

line()

display_output()

line()

print("Thank you.......")
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit
(Intel)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

>>>

=== RESTART: C:/Users/David/Desktop/com project/Admission details


program.py ===

Opened file - Admission details

----------------------------------------------------------------------------------------------------

Do you want to add details? y/n : y

Enter student ID : 12_01

Enter student name : Anish

Enter date of birth : 12_03_2004

Enter gender : Male

Enter department : B.Tech

Enter previous school : Rosemary public school

Enter board : CBSE

Enter cut off : 190

Enter Phone number : 9812763451

Record inserted successfully.....

Do you want to add details? y/n : y

Enter student ID : 12_02

Enter student name : Dina

Enter date of birth : 23_06_2004

Enter gender : Female


Enter department : B.E

Enter previous school : St.Anns high school

Enter board : State

Enter cut off : 180

Enter Phone number : 918273645432

Record inserted successfully.....

Do you want to add details? y/n : n

----------------------------------------------------------------------------------------------------

[1201, 'Anish', 12032004, 'Male', 'B.Tech', 'Rosemary public school', 'CBSE',


190, 9812763451]

[1202, 'Dina', 23062004, 'Female', 'B.E', 'St.Anns high school', 'State', 180,
918273645432]

----------------------------------------------------------------------------------------------------

Thank you.......

>>>
import pickle

def get_input():

with open("Transport_details.dat",'wb') as f:

print("Opened file - Transport details")

for i in range(100):

print("-",end="")

print()

choice=""

choice=str(input("Do you want to add details? y/n : "))

while choice=="y" :

ID=int(input("Enter Driver ID : "))

name=str(input("Enter Driver name : "))

sal=int(input("Enter salary : "))

contact=int(input("Enter Phone number : "))

vehicle=str(input("Enter vehicle : "))

v_num=str(input("Enter vehicle number : "))

c=int(input("Enter capacity : "))

p=int(input("Enter Price : "))

ins=str(input("Insurance : "))

rec=[ID,name,sal,contact,vehicle,v_num,c,p,ins]

pickle.dump(rec,f)

print("Record inserted successfully.....")

choice=str(input("Do you want to add details? y/n : "))


def display_output():

L1=[]

f1=open("Transport_details.dat",'rb')

while True:

try:

data=pickle.load(f1)

print(data)

except EOFError:

break

f1.close()

def line():

for i in range(100):

print("-",end="")

print()

#Main Program

get_input()

line()

display_output()

line()

print("Thank you.......")
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit
(Intel)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

>>>

=== RESTART: C:/Users/David/Desktop/com project/Transport details


program.py ===

Opened file - Transport details

----------------------------------------------------------------------------------------------------

Do you want to add details? y/n : y

Enter Driver ID : 10_01

Enter Driver name : Shankar

Enter salary : 10000

Enter Phone number : 7869543421

Enter vehicle : Bus

Enter vehicle number : TN 72 A 4352

Enter capacity : 50

Enter Price : 500000

Insurance : purchased

Record inserted successfully.....

Do you want to add details? y/n : y

Enter Driver ID : 10_02

Enter Driver name : Suresh

Enter salary : 10000

Enter Phone number : 6758904356


Enter vehicle : Van

Enter vehicle number : TN 72 B 8796

Enter capacity : 25

Enter Price : 300000

Insurance : purchased

Record inserted successfully.....

Do you want to add details? y/n : n

----------------------------------------------------------------------------------------------------

[1001, 'Shankar', 10000, 7869543421, 'Bus', 'TN 72 A 4352', 50, 500000,


'purchased']

[1002, 'Suresh', 10000, 6758904356, 'Van', 'TN 72 B 8796', 25, 300000,


'purchased']

----------------------------------------------------------------------------------------------------

Thank you.......

>>>

You might also like