ADD file via upload

main
p85pylmu6 6 months ago
parent ad6e804eb4
commit 76ef471efd

@ -0,0 +1,24 @@
import pickle
import sqlite3
def create_admin():
"""创建管理员默认为admin:admin"""
with open("administrators.pickle", "wb") as fp:
pickle.dump(("admin", "admin"), fp)
def create_db():
"""创建数据库文件,添加表"""
con = sqlite3.connect("./car_info.db")
cur = con.cursor()
cur.execute('create table car(id varchar primary key, name varchar, color varchar, addr varchar, phone int, stay_hours TEXT)')
con.commit()
cur.close()
con.close()
# create_admin()
create_db()
Loading…
Cancel
Save