small commit for refacotring
This commit is contained in:
10
main.py
10
main.py
@@ -177,8 +177,8 @@ def importCSV(filename: str):
|
|||||||
|
|
||||||
csvReader = csv.reader(open("yeet.csv"), delimiter=",", quotechar='"')
|
csvReader = csv.reader(open("yeet.csv"), delimiter=",", quotechar='"')
|
||||||
|
|
||||||
filepart = filename.split(".")[0]
|
filepart = filename.split(".")[0] + ".db"
|
||||||
conn = sqlite3.connect(f"{filepart}.db")
|
conn = sqlite3.connect(filepart)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute(CREATE_TABLE_COMMAND)
|
c.execute(CREATE_TABLE_COMMAND)
|
||||||
|
|
||||||
@@ -190,6 +190,12 @@ def importCSV(filename: str):
|
|||||||
c.execute("insert into doordash values (?, ?, ?, ?, ?, ?, ?, ?, ?)", row)
|
c.execute("insert into doordash values (?, ?, ?, ?, ?, ?, ?, ?, ?)", row)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
raise Exception("input csv missing")
|
raise Exception("input csv missing")
|
||||||
|
|||||||
Reference in New Issue
Block a user