Created
February 13, 2009 20:00
-
-
Save kolen/64070 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
import sqlite3 | |
conn = sqlite3.connect('/tmp/example') | |
c = conn.cursor() | |
# Create table | |
c.execute('''create table stocks | |
(date text, trans text, symbol text, | |
qty real, price real)''') | |
for i in xrange(1, 1000): | |
c.execute("""insert into stocks | |
values ('2006-01-05','BUY','RHAT',100,35.14)""") | |
conn.commit() | |
# We can also close the cursor if we are done with it | |
c.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment