kindle manager

This commit is contained in:
gavin
2020-06-11 17:21:16 +08:00
parent c903004b8f
commit 43c602d8d6
38 changed files with 565 additions and 248 deletions

37
tsqllite.py Normal file
View File

@@ -0,0 +1,37 @@
#########################################################
## @file : tsqlite.py
## @desc : test sqlite3
## @create : 2020/06/11
## @author : Chengan
## @email : douboer@gmail.com
#########################################################
import sqlite3
dbname = 'vocab.db'
conn = sqlite3.connect(dbname)
try:
cursor = conn.cursor()
sql1 = '''select * from words;'''
sql2 = '''select * from lookups;'''
# fetch one record
cursor.execute(sql2)
one=cursor.fetchone()
print(one)
# fetch all records
for row in cursor.fetchall():
print(row)
# fetch table structure
except Exception as e:
print('sql failure {}'.format(e))
pass
finally:
conn.close()