-、首先简介pysqlite.
from pysqlite2 import dbapi2 as sqlite3
persons = [
(12,314),
("Calvin", "Klein")
]
con = sqlite3.connect("C:\\aa.db")
# Create the table
#con.execute("create table person(firstname, lastname)")
# Fill the table
con.executemany("insert into person(firstname, lastname) values (?, ?)", persons)
for row in con.execute("select firstname, lastname from person"):
print row
con.close()
二、用处。
在程序运行中,不可能所有的数据都存内存啊,但是又没有其他好地方这就是好地方。存储临时数据。