small commit for refacotring

This commit is contained in:
Ryan Chen
2023-08-29 21:18:50 -07:00
parent 0dd3f56f7f
commit ab5db9d645

10
main.py
View File

@@ -177,8 +177,8 @@ def importCSV(filename: str):
csvReader = csv.reader(open("yeet.csv"), delimiter=",", quotechar='"')
filepart = filename.split(".")[0]
conn = sqlite3.connect(f"{filepart}.db")
filepart = filename.split(".")[0] + ".db"
conn = sqlite3.connect(filepart)
c = conn.cursor()
c.execute(CREATE_TABLE_COMMAND)
@@ -190,6 +190,12 @@ def importCSV(filename: str):
c.execute("insert into doordash values (?, ?, ?, ?, ?, ?, ?, ?, ?)", row)
conn.commit()
if __name__ == "__main__":
if len(sys.argv) < 2:
raise Exception("input csv missing")