写入:
import sqlite3
conn = sqlite3.connect("1.db")
c = conn.cursor()
c.execute("INSERT INTO words (json) VALUES (?)",(bytes(str("呵呵"), encoding = "utf8"),))
读取:
rows = c.execute("select json from words")
for row in rows:
print((row[0].decode('utf-8')))
网友评论