你不需要安裝任何東西對蟒蛇使用sqlite3的。
關於sqlite的:https://www.sqlite.org/about.html
如果您在使用數據庫, 你能想到的sqlite3就像一個數據庫中的文件包括表的一個體驗。
因爲Python支持sqlite3的,你可以做一個新的sqlite3的文件。
本例創建一個新的example.db文件,如果不存在只能使用python。
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
# Create table
c.execute('''CREATE TABLE stocks
(date text, trans text, symbol text, qty real, price real)''')
# Insert a row of data
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")
# Save (commit) the changes
conn.commit()
# We can also close the connection if we are done with it.
# Just be sure any changes have been committed or they will be lost.
conn.close()
閱讀本文檔:https://docs.python.org/2/library/sqlite3.html
但我建議你安裝sqlite的使用命令行Shell SQLite的。
$ sqlite3 ex1
SQLite version 3.8.5 2014-05-29 12:36:14
Enter ".help" for usage hints.
sqlite> create table tbl1(one varchar(10), two smallint);
sqlite> insert into tbl1 values('hello!',10);
sqlite> insert into tbl1 values('goodbye', 20);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite>