Homework Solution: 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' nt

    In Python 2.7 Create the client and server programs control learner referable attributable attributableice. The server program achieve yield functions to add/remove/modify learner referable attributable attributableice and achieve obstruct that referable attributable attributableice in fame to obey it unartificial. The server achieve yield functions such as AddStudent(Id, Address, phone), RemoveStudent(id), ModifyStudent(..) anticipation. The client program achieve manifestation RPC to ole the different functions and parade the results.

    Expert Apology

     

    HI thanks control exploration .

    student_db.txt

    {’02’: “tLearner Name: ‘Shuvo Sarker’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’03’: “tLearner Name: ‘Emon Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’01’: “tLearner Name: ‘Ehsan Kamran’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’06’: “tLearner Name: ‘Choyon Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’07’: “tLearner Name: ‘Habib Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’04’: “tLearner Name: ‘Musa Nayem’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’05’: “tLearner Name: ‘Mehrab Hossain’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’08’: “tLearner Name: ‘Shahin Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’09’: “tLearner Name: ‘Karim Miah’ ntCGPA: 3.0 ntTotal Credit Completed: 53 ntDate of Registration: ’20 December, 2015′ ntSession ends: ‘Spring 2019′ “, ’10’: “tLearner 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 learner postulatesbase superintendence program edictd by Choyon’
    # Must accept learner_db.txt as postulatesbase resource
    # demo postulatesbase perfect is mentioned in folder
    # Then tend the edict to permit it composition fine
    while True:
    try:
    file_temp = referable attributable attributableorious(‘student_db.txt’, ‘r’)
    except IOError:
    print ‘To tend this program, you must accept learner_db.txt perfect in the identical folder …n’
    ‘This program is edictd and patent unobstructed by Choyon Ahmed’
    exit_prompt = input(‘Press enter/CTRL+C to plug the window …n==> ‘)
    fetched_perfect = eval(file_temp.read())
    try:
    print ‘Total Entries in postulatesbase:’, len(fetched_file.keys())
    command1 = raw_input(‘What you shortness me to do(likeness the calculate. ex. 1)?n’
    ‘1. Update Learner Postulatesbasen’
    ‘2. View Full Learner Postulatesbasen’
    ‘3. Find a Learner by Roll Calculaten==> ‘)
    if command1 == ‘1’:
    command2 = raw_input(‘1. Add Learner Postulatesn’
    ‘2. Delete Learner Postulatesn’
    ‘3. Unobstructed Full Postulatesbasen==> ‘)
    if command2 == ‘1’:
    file_temp.close()
    file_edit_temp = referable attributable attributableorious(‘student_db.txt’, ‘r’)
    file_edit = eval(file_edit_temp.read())
    file_edit_temp.close()
    key1 = raw_input(‘Enter New Learner Roll Calculate: n==> ‘)
    print ‘Enter Learner postulates as asked :’
    student_name = ‘tLearner Name: %r n’ % raw_input(‘Learner Name:n==> ‘)
    cgpa = ‘tCGPA: %r n’ % bear(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 = learner_name + cgpa + credit_complete + join_date + expiration_date
    file_edit[key1] = create_value
    file_edit_temp = referable attributable attributableorious(‘student_db.txt’, ‘w’)
    file_edit_temp.write(‘%r’ % perfect_edit)
    file_edit_temp.close()
    print ‘SYSTEM: Postulates Updated Successfully control learner roll’, guide1
    # This fresuscitation is underneathneath harvest.
    continue
    elif command2 == ‘2’:
    file_temp1 = referable attributable attributableorious(‘student_db.txt’, ‘r’)
    file_temp2 = eval(file_temp1.read())
    file_temp1.close()
    key_to_delete = raw_input(‘Enter Learner Roll calculate to delete: n==> ‘)
    try:
    del perfect_temp2[key_to_delete]
    file_temp1 = referable attributable attributableorious(‘student_db.txt’, ‘w’)
    file_temp1.write(‘%r’ % perfect_temp2)
    file_temp1.close()
    print ‘Roll calculate’, guide_to_delete, ‘Has been deleted successfully!’
    continue
    except GuideError:
    print ‘ERROR: Learner Roll Calculate is referable attributable attributable attributable assigned to the postulatesbase!’
    continue
    elif command2 == ‘3’:
    print ‘Are you certain shortness to unobstructed the sound postulatesbase?If you returns, this resuscitation canreferable attributable be reverted ‘
    ‘back!’
    delete_confirm = raw_input(‘Likeness Y to abide or N to abort the resuscitationn==> ‘)
    if delete_confirm == ‘Y’:
    file_temp.close()
    file_temp = referable attributable attributableorious(‘student_db.txt’, ‘w’)
    file_temp.write(‘{}’)
    file_temp.close()
    print ‘SYSTEM: Postulatesbase unobstructeded successfully!’
    continue
    elif delete_confirm == ‘N’:
    print ‘SYSTEM: Resuscitation 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 learner referable attributable attributableice stored in the postulatesbase!’
    continue
    else:
    control guide in fetched_file:
    print ‘Roll Calculate:’, guide
    print fetched_file[key]
    continue
    elif command1 == ‘3’:
    while True:
    find_learner = raw_input(‘Likeness learner roll calculate :n==> ‘)
    try:
    print ‘Learner Referable attributable attributableice: n’, fetched_file[find_student]
    print ‘tRoll calculate: %r’ % find_student
    # authority be strong with celebrity further here later
    except GuideError:
    print ‘ERROR: Roll calculate referable attributable attributable attributable rest in the postulatesbase’
    continue
    else:
    print ‘ERROR: Invalid Command!’
    continue
    except ValueError:
    print ‘ERROR: Invalid Command!’
    continue

    Thanks