“inf551” database to the user (see mysql connector slide). Do not include create table and grant privilege statements, which should be done separately , in your Python code other than insertion. Your script should obtain the database connection using the following call (same as that in the slide). cnx = mysql.connector.connect(user='inf551', password='inf551', host='127.0.0.1', database='inf551') Your script takes only one argument ( lax.json ): Execution: python load.py lax.json Submission: <FirstName>_<LastName>_load.py
INF 551 – Spring 2017 b. [25 points] Write a Python script lax.py that takes two keywords (that specify the search condition) as the input, and outputs the total number of passengers in the records that satisfy the condition. The first keyword is either “ Departure ” or “ Arrival ”; the second is a four-digit year, e.g., 2006 . There’re only and always these two kind of keywords. For example, “ python lax.py Arrival 2015 ” will return the number of passengers that arrived in 2015.
You've reached the end of your free preview.
Want to read all 3 pages?
- Fall '14
- Tom Bradley International Terminal