Skip to content

Instantly share code, notes, and snippets.

@elseagle
Created May 25, 2019 01:40
Show Gist options
  • Save elseagle/514b1770805e003c2b1c7da2d63ccaa9 to your computer and use it in GitHub Desktop.
Save elseagle/514b1770805e003c2b1c7da2d63ccaa9 to your computer and use it in GitHub Desktop.
import sqlite3
connection = sqlite3.connect('data.db')
cursor = connection.cursor()
create_table = "CREATE TABLE IF NOT EXISTS items (name text PRIMARY KEY, price real)"
cursor.execute(create_table)
connection.commit()
connection.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment