Python sqlite3 cursor has no attribute commit

Viewed 26370

When I run this code:

path = '~/Scripts/wallpapers/single.png'
conn = sqlite3.connect('/Users/Heaven/Library/Application Support/Dock/desktoppicture.db')
cur = conn.cursor();
cur.execute("insert into data values ('" + path + "');")
cur.commit()

I receive the following error

AttributeError: 'sqlite3.Cursor' object has no attribute 'commit'

and I have absolutely no idea why.

3 Answers
Related