程序运行正常,但不会在数据库中插入任何内容。我不明白!
import sqlite3 as db
conn = db.connect('C:\\SQLite\\test.db')
cursor = conn.cursor()
answer = "ok"
while answer != "":
title = raw_input("Enter film: ")
year = raw_input("Enter year: ")
director = raw_input("Enter director: ")
cursor.execute("insert into films (title, year, director) values (?, ?, ?)", (title, year, director))
answer = raw_input("Continue? ")
conn.close()