Question: Answer this question? Write a Python program, h7.py to list all swimmers with caretaker id ct_id in the following manner. Note that the swimmer names,

Answer this question?

Write a Python program, h7.py to list all swimmers with caretaker id ct_id in the following manner. Note that the swimmer names, whether ct_id is a primary or other caretaker, and the numbers of events the swimmers participated in are shown.

Note that ct_id is input as a command line argument and you may assume that there will be no input error. For example:

...>python h7.py 1 Swimmer under care of caretaker #1 ------------------------------------ Billy Khan (as primary caretaker)> participated in 4 events. Bobby Khan (as primary caretaker)> participated in 4 events. Nina Khan (as other caretaker)> participated in 4 events. Please pay attention to details.

Your program should import dbconfig.py (copy below and save it in the file name in the same directory):

import configparser # simplistic and no error handling. def get_mysql_param(filename='dbconfig.ini', section='mysql'): config = configparser.ConfigParser() config.read(filename) return config['mysql']

which in turn reads the dbconfig.ini file:

[mysql] host = localhost database = clystms user = > password = >

relationship Since LevelHistory Swimmer Caretaker Commitment -for- Swimmerld FName LName Phone EMail Join T ime StartDate Other caretaker- CommitTime Rescinded RescindTime CarriedOut Comment Comment CT ld FName LName Phone EMail Main caretaker of currentLevel Relationship Since commentBy on of Level Levelld Level Description V Task Partipication Coach Name Comment Num V Committed CommitTime Participated Result Comment Coachld FName LName Phone EMail commentBy V TaskList of Required on Description / Penalty /PenaltyAmt coachlnCharge of Event Meet Venue Eventlo Title StartTime EndTime Meetld Title Date StartTime End Time in Venueld Address in State ZipCode Phone Name relationship Since LevelHistory Swimmer Caretaker Commitment -for- Swimmerld FName LName Phone EMail Join T ime StartDate Other caretaker- CommitTime Rescinded RescindTime CarriedOut Comment Comment CT ld FName LName Phone EMail Main caretaker of currentLevel Relationship Since commentBy on of Level Levelld Level Description V Task Partipication Coach Name Comment Num V Committed CommitTime Participated Result Comment Coachld FName LName Phone EMail commentBy V TaskList of Required on Description / Penalty /PenaltyAmt coachlnCharge of Event Meet Venue Eventlo Title StartTime EndTime Meetld Title Date StartTime End Time in Venueld Address in State ZipCode Phone Name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!