Archived
更新数据库名称
This commit is contained in:
10 files changed
+180
-130
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
# -- coding:utf-8 --
|
||||
# @Author: markushammered@gmail.com
|
||||
# @Development Tool: PyCharm
|
||||
# @Create Time: 2022/2/16
|
||||
# @File Name: connectdb.py
|
||||
|
||||
|
||||
import sqlite3
|
||||
|
||||
|
||||
def exec(cmd):
|
||||
try:
|
||||
conn = sqlite3.connect('../../db/count.db')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(cmd)
|
||||
return cursor.fetchall()
|
||||
finally:
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
while True:
|
||||
cmd = input('>>>')
|
||||
print(exec(cmd))
|
||||
|
||||
Reference in New Issue
Block a user