私は 3 時間を失いましたが、何が間違っているのかわかりません。助けてください。エラーが発生しないため、更新ステートメントで必要なキーを渡さないという結論に達しましたが、データベースも更新されません。
conn = sqlite3.connect('mov.db')
c = conn.cursor()
old_rows = c.execute('SELECT imdb FROM movies WHERE desc="" and imdb<>"" and year<"1997"')
result = c.fetchall()
for row in result:
key = row[0] [2:]
try:
# Get a Movie object with the data about the movie identified by
# the given movieID.
movie = i.get_movie(key)
except IMDbError, e:
print "Probably you're not connected to Internet. Complete error report:"
print e
continue
print movie['title']
if movie.has_key('plot outline'):
m=movie['plot outline']
print m
print key
c.execute('UPDATE movies SET desc=? WHERE imdb=?',(m,key))
print c.rowcount
# Commit the changes and close everything.
conn.commit()
c.close()
conn.close()