1234567891011121314151617181920212223242526272829303132333435 |
- import sqlite3
- import Stateful
- def Operate_sqlite3(dbPath, commands):
- con = sqlite3.connect(dbPath)
- cur = con.cursor()
-
- try:
- res = cur.execute(commands)
- con.commit()
- print("res.fetchone() is None: ", res.fetchone() is None)
-
- if res.fetchone() is None == True:
- print("err <Code>: could not found, creat? y/n")
- except:
- print("err <Code>: Syntax error")
- con.close()
- if __name__ == "__main__":
-
-
-
-
- data = [
- ('null', 'CL2', 'KB2', 'alive')
- ]
- sqls = ""
|