Skip to content

Instantly share code, notes, and snippets.

@elseagle
Created May 25, 2019 02:49
Show Gist options
  • Save elseagle/0dc7ce99bebeda65b08fdf6767045649 to your computer and use it in GitHub Desktop.
Save elseagle/0dc7ce99bebeda65b08fdf6767045649 to your computer and use it in GitHub Desktop.
def insert(item):
connection = sqlite3.connect('data.db')
cursor = connection.cursor()
query = "INSERT INTO {table} VALUES(?, ?)"
cursor.execute(query, (item['name'], item['price']))
connection.commit()
connection.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment