Created
January 5, 2013 22:38
-
-
Save mariomartinezsz/4464096 to your computer and use it in GitHub Desktop.
Create a SQLite db and a table with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
cnn = sqlite3.connect('mydata.db') | |
mycursor = cnn.cursor() | |
# create table | |
sql_new_table = '''create table products | |
(code text, desc text, value real)''' | |
mycursor.execute(sql_new_table) | |
cnn.commit() | |
mycursor.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment