This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
importpickle
importsqlite3
defcreate_admin():
"""创建管理员,默认为admin:admin"""
withopen("administrators.pickle","wb")asfp:
pickle.dump(("admin","admin"),fp)
defcreate_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)')