<p>我在Windows 8 x64上运行以下代码:</p>
<pre><code>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()
</code></pre>
<p>检查创建的SQLite文件(测试.db)(使用<a href="http://www.sqlite.org/2013/sqlite-shell-win32-x86-3071700.zip" rel="nofollow">sqlite command-line shell</a>测试通过代码创建的表中是否有条目)没有显示任何内容。有什么帮助吗?你知道吗</p>