sqlite3
- 可视化工具
sudo apt-get install sqlitebrowser
sqlitebrowser test.db
- 使用方法
import sqlite3 as s3
con = s3.connect('frist.db')
cur = con.cursor()
cur.execute('create table t_fish(date text,name text,nums int,price real,explain text)')
cur.execute('''insert into t_fish values('2018-3-28,'黑鱼','10,'28.3','tom')''')
cur.execute(''' UPDATE t_fish SET name='红鱼' WHERE date = '2018-4-27' ''')
result = cur.execute('''select * from t_fish where date = '2018-3-28' ''')
for x in result:
print(x)
con.commit()
con.close()

浙公网安备 33010602011771号