-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsql.py
More file actions
29 lines (19 loc) · 774 Bytes
/
Copy pathsql.py
File metadata and controls
29 lines (19 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pandas as pd
import sqlite3
from datetime import date
import sys
dbname = sys.argv[1]
status = sqlite3.connect(f"sql/{dbname}.db")
status.execute(f"drop table if exists {dbname}")
try:
status.execute(f"create table {dbname}(name text,imgcode text,oriprice int, price int, color int,feature text,gender int ,brand text,fabric text, path text,ver int)")
print("execute")
except Exception as e:
print(e)
print("Already table existed !!")
status = sqlite3.connect(f"sql/{dbname}.db")
# data = ("Classic Down Parka", "parka_001", 199, 179, 1, "waterproof and warm", 1, "Eddie Bauer", "down","crawer\sql.ipynb")
# status.execute(f"insert into {dbname} values (?,?,?,?,?,?,?,?,?,?)",data)
# status.commit()
status.execute("VACUUM;")
status.close()