Python SQLite: database is locked

后端 未结 20 1171
一生所求
一生所求 2020-12-12 14:24

I\'m trying this code:

import sqlite

connection = sqlite.connect(\'cache.db\')
cur = connection.cursor()
cur.execute(\'\'\'create table item
  (id integer p         


        
20条回答
  •  隐瞒了意图╮
    2020-12-12 15:14

    Set the timeout parameter in your connect call, as in:

    connection = sqlite.connect('cache.db', timeout=10)
    

提交回复
热议问题