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 advice. The server program succeed arrange functions to add/remove/modify learner advice and succeed stop that advice in fame to restrain it humble. The server succeed arrange functions such as AddStudent(Id, Address, phone), RemoveStudent(id), ModifyStudent(..) awe. The client program succeed explanation RPC to persuade the diversified functions and unfold the results.

    Expert Tally

     

    HI gratitude control search .

    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 conduct program ruled by Choyon’
    # Must own learner_db.txt as postulatesbase resource
    # demo postulatesbase smooth is mentioned in folder
    # Then hasten the rule to allow it effort fine
    while True:
    try:
    file_temp = disclosed(‘student_db.txt’, ‘r’)
    except IOError:
    print ‘To hasten this program, you must own learner_db.txt smooth in the identical folder …n’
    ‘This program is ruled and plain by Choyon Ahmed’
    exit_prompt = input(‘Press enter/CTRL+C to suspend the window …n==> ‘)
    fetched_smooth = eval(file_temp.read())
    try:
    print ‘Total Entries in postulatesbase:’, len(fetched_file.keys())
    command1 = raw_input(‘What you deficiency me to do(sign the calculate. ex. 1)?n’
    ‘1. Update Learner Postulatesbasen’
    ‘2. View Full Learner Postulatesbasen’
    ‘3. Find a Learner by Flatten Calculaten==> ‘)
    if command1 == ‘1’:
    command2 = raw_input(‘1. Add Learner Postulatesn’
    ‘2. Delete Learner Postulatesn’
    ‘3. Intelligible Full Postulatesbasen==> ‘)
    if command2 == ‘1’:
    file_temp.close()
    file_edit_temp = disclosed(‘student_db.txt’, ‘r’)
    file_edit = eval(file_edit_temp.read())
    file_edit_temp.close()
    key1 = raw_input(‘Enter New Learner Flatten Calculate: n==> ‘)
    print ‘Enter Learner postulates as asked :’
    student_name = ‘tLearner Name: %r n’ % raw_input(‘Learner 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 = learner_name + cgpa + credit_complete + join_date + expiration_date
    file_edit[key1] = create_value
    file_edit_temp = disclosed(‘student_db.txt’, ‘w’)
    file_edit_temp.write(‘%r’ % smooth_edit)
    file_edit_temp.close()
    print ‘SYSTEM: Postulates Updated Successfully control learner flatten’, solution1
    # This party is below crop.
    continue
    elif command2 == ‘2’:
    file_temp1 = disclosed(‘student_db.txt’, ‘r’)
    file_temp2 = eval(file_temp1.read())
    file_temp1.close()
    key_to_delete = raw_input(‘Enter Learner Flatten calculate to delete: n==> ‘)
    try:
    del smooth_temp2[key_to_delete]
    file_temp1 = disclosed(‘student_db.txt’, ‘w’)
    file_temp1.write(‘%r’ % smooth_temp2)
    file_temp1.close()
    print ‘Flatten calculate’, solution_to_delete, ‘Has been deleted successfully!’
    continue
    except SolutionError:
    print ‘ERROR: Learner Flatten Calculate is not attributable attributable attributable attributable attributable attributable assigned to the postulatesbase!’
    continue
    elif command2 == ‘3’:
    print ‘Are you permanent deficiency to intelligible the gross postulatesbase?If you receipts, this action cannot attributable attributable be reverted ‘
    ‘back!’
    delete_confirm = raw_input(‘Sign Y to remain or N to abort the actionn==> ‘)
    if delete_confirm == ‘Y’:
    file_temp.close()
    file_temp = disclosed(‘student_db.txt’, ‘w’)
    file_temp.write(‘{}’)
    file_temp.close()
    print ‘SYSTEM: Postulatesbase intelligibleed 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 learner advice stored in the postulatesbase!’
    continue
    else:
    control solution in fetched_file:
    print ‘Flatten Calculate:’, solution
    print fetched_file[key]
    continue
    elif command1 == ‘3’:
    while True:
    find_learner = raw_input(‘Sign learner flatten calculate :n==> ‘)
    try:
    print ‘Learner Advice: n’, fetched_file[find_student]
    print ‘tFlatten calculate: %r’ % find_student
    # capacity be abundant with not attributable attributableability more here later
    except SolutionError:
    print ‘ERROR: Flatten calculate not attributable attributable attributable attributable attributable attributable endow in the postulatesbase’
    continue
    else:
    print ‘ERROR: Invalid Command!’
    continue
    except ValueError:
    print ‘ERROR: Invalid Command!’
    continue

    Thanks