This commit is contained in:
MarkusJoe
2022-02-19 10:45:00 +08:00
parent caa012dd9b
commit 48364cfc64
12 files changed
+14 -173

No files matched your search

+6 -2
View File
@@ -13,8 +13,12 @@ if __name__ == '__main__':
while True:
yes_or_no = input('该操作会将数据库初始化输入y继续:')
if yes_or_no == 'y':
os.remove('../../db/data.db')
conn = sqlite3.connect('../../db/data.db')
try:
os.remove('../../db/count.db')
except PermissionError:
print('有其他程序正在使用此数据库无法删除')
sys.exit(-1)
conn = sqlite3.connect('../../db/count.db')
cursor = conn.cursor()
cursor.execute('create table ReqCount (name text primary key, times integer )')
sys.exit(0)