Код: Выделить всё
import sqlite3
conn = sqlite3.connect(':memory:')
c = conn.cursor()
c.execute(...)
c.close()
Код: Выделить всё
with conn.cursor() as c:
c.execute(...)
Код: Выделить всё
AttributeError: __exit__
Подробнее здесь: https://stackoverflow.com/questions/534 ... ith-sqlite