我已经在Windows 8上运行的x64下面的代码:的SQLite 3数据库没有更新
import sqlite3 as db
conn = db.connect('test.db')
cursor = conn.cursor()
cursor.execute("create table films(title text, year text, director text)")
print("table created")
cursor.execute('insert into films values("Annie Hall","1977","Woody Allen")')
cursor.execute('insert into films values("The Godfather","1972","Francis Ford Coppola")')
conn.close()
检查所创建的SQLite的文件(test.db的)(使用sqlite command-line shell,以测试是否有条目通过代码创建的表)不显示任何内容。任何帮助?
根据定义DB-API的[PEP](http://www.python.org/dev/peps/pep-0249/),只有当他以事务模式运行并且对数据库事务的支持是可选的时, – hd1
如果我没有记错'isolation_level'默认不是* autocommit *模式。无论如何,我只是按照手动示例:http://docs.python.org/3/library/sqlite3.html :) –