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 restraint scholar advice. The server program procure cater functions to add/remove/modify scholar advice and procure obstruct that advice in reminiscence to adhere-to it unblended. The server procure cater functions such as AddStudent(Id, Address, phone), RemoveStudent(id), ModifyStudent(..) etc. The client program procure correction RPC to call the sundry functions and exhibit the results.

    Expert Exculpation

     

    HI benediction restraint investigation .

    student_db.txt

    {’02’: “tScholar Name: ‘Shuvo Sarker’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’03’: “tScholar Name: ‘Emon Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’01’: “tScholar Name: ‘Ehsan Kamran’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’06’: “tScholar Name: ‘Choyon Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’07’: “tScholar Name: ‘Habib Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’04’: “tScholar Name: ‘Musa Nayem’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’05’: “tScholar Name: ‘Mehrab Hossain’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’08’: “tScholar Name: ‘Shahin Ahmed’ ntCGPA: ‘3.5’ ntTotal Credit Completed: ’52’ ntDate of Registration: ’20 May, 2016′ ntSession ends: ‘Spring 2020′ “, ’09’: “tScholar Name: ‘Karim Miah’ ntCGPA: 3.0 ntTotal Credit Completed: 53 ntDate of Registration: ’20 December, 2015′ ntSession ends: ‘Spring 2019′ “, ’10’: “tScholar 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 scholar groundsbase superintendence program adjudicationd by Choyon’
    # Must feel scholar_db.txt as groundsbase resource
    # demo groundsbase finish is mentioned in folder
    # Then traverse the adjudication to suffer it effort fine
    while True:
    try:
    file_temp = referable attributable attributableorious(‘student_db.txt’, ‘r’)
    except IOError:
    print ‘To traverse this program, you must feel scholar_db.txt finish in the identical folder …n’
    ‘This program is adjudicationd and public by Choyon Ahmed’
    exit_prompt = input(‘Press enter/CTRL+C to bar the window …n==> ‘)
    fetched_finish = eval(file_temp.read())
    try:
    print ‘Total Entries in groundsbase:’, len(fetched_file.keys())
    command1 = raw_input(‘What you shortness me to do(stamp the sum. ex. 1)?n’
    ‘1. Update Scholar Groundsbasen’
    ‘2. View Full Scholar Groundsbasen’
    ‘3. Find a Scholar by Flatten Sumn==> ‘)
    if command1 == ‘1’:
    command2 = raw_input(‘1. Add Scholar Groundsn’
    ‘2. Delete Scholar Groundsn’
    ‘3. Disencumbered Full Groundsbasen==> ‘)
    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 Scholar Flatten Sum: n==> ‘)
    print ‘Enter Scholar grounds as asked :’
    student_name = ‘tScholar Name: %r n’ % raw_input(‘Scholar Name:n==> ‘)
    cgpa = ‘tCGPA: %r n’ % transport(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 = scholar_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’ % finish_edit)
    file_edit_temp.close()
    print ‘SYSTEM: Grounds Updated Successfully restraint scholar flatten’, clew1
    # This frresuscitation is beneath 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 Scholar Flatten sum to delete: n==> ‘)
    try:
    del finish_temp2[key_to_delete]
    file_temp1 = referable attributable attributableorious(‘student_db.txt’, ‘w’)
    file_temp1.write(‘%r’ % finish_temp2)
    file_temp1.close()
    print ‘Flatten sum’, clew_to_delete, ‘Has been deleted successfully!’
    continue
    except ClewError:
    print ‘ERROR: Scholar Flatten Sum is referable attributable attributable attributable assigned to the groundsbase!’
    continue
    elif command2 == ‘3’:
    print ‘Are you assured shortness to disencumbered the undiminished groundsbase?If you profits, this resuscitation canreferable attributable be reverted ‘
    ‘back!’
    delete_confirm = raw_input(‘Stamp Y to endure 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: Groundsbase disencumbereded 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 scholar advice stored in the groundsbase!’
    continue
    else:
    restraint clew in fetched_file:
    print ‘Flatten Sum:’, clew
    print fetched_file[key]
    continue
    elif command1 == ‘3’:
    while True:
    find_scholar = raw_input(‘Stamp scholar flatten sum :n==> ‘)
    try:
    print ‘Scholar Advice: n’, fetched_file[find_student]
    print ‘tFlatten sum: %r’ % find_student
    # faculty be exuberant with something further here later
    except ClewError:
    print ‘ERROR: Flatten sum referable attributable attributable attributable fix in the groundsbase’
    continue
    else:
    print ‘ERROR: Invalid Command!’
    continue
    except ValueError:
    print ‘ERROR: Invalid Command!’
    continue

    Thanks