Skip to content

Homework 1 #1

@abshughes

Description

@abshughes

Hi Tom,
Below is my review of your homework 1.

You did a great job, the program runs and shows what it is supposed to show.
I have a few comments on some parts, which could be done a bit differently.

  1. The assignment mentions to use json.loads(), instead of json.load()
    The difference between them is that json.load() takes a string argument and json.loads() takes file as an object. The documentation on json.loads() is here
    https://docs.python.org/2.7/library/json.html#json.loads
  2. You used parse to parse the data, and it worked great.
    However, we were advised to use datetime.datetime.strftime function to convert the string
    dates = datetime.datetime.strptime(i, '%Y-%m-%d %H:%M:%S')
    the documentation is here
    https://docs.python.org/2/library/datetime.html?highlight=datetime.strptime#strftime-and-strptime-behavior
  3. You didn't close the connection to sqlite3: conn.close() and the files itself json_data.close()
    Every time you close the object, you discard memory buffer, what is nothing in this exercise but might be more significant after.

Hope these comments help!
Anna

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions