【发布时间】:2014-02-23 11:47:27
【问题描述】:
我正在使用 Python 通过 SQLite3 创建一个表,我被告知该表已在解释器中创建,但是在 cmd 中查看该表时,没有这样的表。这是我的代码:
import sqlite3 as db
conn = db.connect('test.db')
cursor = conn.cursor()
cursor.execute("create table films(title text, year text, director text)")
print("tables added")
在解释器中我得到:
>>> ================================ RESTART ================================
>>>
tables added
但是当我在 cmd 中通过 SQLite 查看数据库时,我被告知:
Error: no such table: films
【问题讨论】:
标签: python sql python-3.x sqlite