Answered Essay: In Python 2.7 Create the client and server programs for student information. The server program will provide functions to ad

In Python 2.7 Create the client and server programs for student information. The server program will provide functions to add/remove/modify student information and will hold that information in memory to keep it simple. The server will provide functions such as AddStudent(Id, Address, phone), RemoveStudent(id), ModifyStudent(..) etc. The client program will use RPC to call the various functions and display the results.

Expert Answer

 

HI thanks for asking .

student_db.txt

{’02’: “tStudent Name: ‘Shuvo Sarker’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’03’: “tStudent Name: ‘Emon Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’01’: “tStudent Name: ‘Ehsan Kamran’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’06’: “tStudent Name: ‘Choyon Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’07’: “tStudent Name: ‘Habib Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’04’: “tStudent Name: ‘Musa Nayem’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’05’: “tStudent Name: ‘Mehrab Hossain’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’08’: “tStudent Name: ‘Shahin Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’09’: “tStudent Name: ‘Karim Miah’ ntCGPA: 3.0 ntTotal Credit Completed: 53 ntDate of Registration: ’20 December, 2015′ ntSession ends: ‘Spring 2019′ “, ’10’: “tStudent Name: ‘Badshah Khan Bahadur’ ntCGPA: 3.9 ntTotal Credit Completed: 251 ntDate of Registration: ’20 September, 2013′ ntSession ends: ‘Spring 2017’ “}

StudentDB.py

print ‘Welcome to student database management program coded by Choyon’
# Must have student_db.txt as database resource
# demo database file is mentioned in folder
# Then run the code to let it work fine
while True:
try:
file_temp = open(‘student_db.txt’, ‘r’)
except IOError:
print ‘To run this program, you must have student_db.txt file in the same folder …n’
‘This program is coded and developed by Choyon Ahmed’
exit_prompt = input(‘Press enter/CTRL+C to close the window …n==> ‘)
fetched_file = eval(file_temp.read())
try:
print ‘Total Entries in database:’, len(fetched_file.keys())
command1 = raw_input(‘What you want me to do(type the number. ex. 1)?n’
‘1. Update Student Databasen’
‘2. View Full Student Databasen’
‘3. Find a Student by Roll Numbern==> ‘)
if command1 == ‘1’:
command2 = raw_input(‘1. Add Student Datan’
‘2. Delete Student Datan’
‘3. Clear Full Databasen==> ‘)
if command2 == ‘1’:
file_temp.close()
file_edit_temp = open(‘student_db.txt’, ‘r’)
file_edit = eval(file_edit_temp.read())
file_edit_temp.close()
key1 = raw_input(‘Enter New Student Roll Number: n==> ‘)
print ‘Enter Student data as asked :’
student_name = ‘tStudent Name: %r n’ % raw_input(‘Student Name:n==> ‘)
cgpa = ‘tCGPA: %r n’ % float(raw_input(‘CGPA: n==> ‘))
credit_complete = ‘tTotal Credit Completed: %r n’ % int(raw_input(‘Total Credit Completed: n==> ‘))
join_date = ‘tDate of Registration: %r n’ % raw_input(‘Date of Registration: n==> ‘)
expiration_date = ‘tSession ends: %r ‘ % raw_input(‘Session ends: n==> ‘)
create_value = student_name + cgpa + credit_complete + join_date + expiration_date
file_edit[key1] = create_value
file_edit_temp = open(‘student_db.txt’, ‘w’)
file_edit_temp.write(‘%r’ % file_edit)
file_edit_temp.close()
print ‘SYSTEM: Data Updated Successfully for student roll’, key1
# This portion is under development.
continue
elif command2 == ‘2’:
file_temp1 = open(‘student_db.txt’, ‘r’)
file_temp2 = eval(file_temp1.read())
file_temp1.close()
key_to_delete = raw_input(‘Enter Student Roll number to delete: n==> ‘)
try:
del file_temp2[key_to_delete]
file_temp1 = open(‘student_db.txt’, ‘w’)
file_temp1.write(‘%r’ % file_temp2)
file_temp1.close()
print ‘Roll number’, key_to_delete, ‘Has been deleted successfully!’
continue
except KeyError:
print ‘ERROR: Student Roll Number is not assigned to the database!’
continue
elif command2 == ‘3’:
print ‘Are you sure want to clear the whole database?If you proceed, this action cannot be reverted ‘
‘back!’
delete_confirm = raw_input(‘Type Y to continue or N to abort the actionn==> ‘)
if delete_confirm == ‘Y’:
file_temp.close()
file_temp = open(‘student_db.txt’, ‘w’)
file_temp.write(‘{}’)
file_temp.close()
print ‘SYSTEM: Database cleared successfully!’
continue
elif delete_confirm == ‘N’:
print ‘SYSTEM: Action Aborted …’
continue
else:
print ‘SYSTEM: Invalid Command!’
continue
else:
print ‘ERROR: Invalid Command!’
continue
elif command1 == ‘2’:
checkme = len(fetched_file.keys())
if checkme == 0:
print ‘SYSTEM: There is no student information stored in the database!’
continue
else:
for key in fetched_file:
print ‘Roll Number:’, key
print fetched_file[key]
continue
elif command1 == ‘3’:
while True:
find_student = raw_input(‘Type student roll number :n==> ‘)
try:
print ‘Student Information: n’, fetched_file[find_student]
print ‘tRoll number: %r’ % find_student
# might be extended with something more here later
except KeyError:
print ‘ERROR: Roll number not found in the database’
continue
else:
print ‘ERROR: Invalid Command!’
continue
except ValueError:
print ‘ERROR: Invalid Command!’
continue

Thanks

Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.

× How can I help you?