0

I don't know why my code pset7 houses pass all check but when i submit it i just take 17% on progress. Who can help me?. This my code: import.py

from cs50 import SQL
import csv
import sys

def main():
    if len(sys.argv) != 2:
        sys.exit("Usage: import.py file.csv")

    filename = sys.argv[1]

    if not filename.endswith(".csv"):
        sys.exit("You must provide a *.csv")

    # Connect with the .db file
    db = SQL("sqlite:///students.db")

    with open("characters.csv", "r") as characters:

[code snipped]

1 Answer 1

1

You are hard-coding the csv filename when the spec requires that you take the filename from the command line arguments.

If run like this:

$ python import.py thisfile.csv

you should use "thisfile.csv" not "characters.csv" for example.

1
  • ya, thank y, I understand it :V Commented Mar 20, 2020 at 2:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .