On 3/6/2013 1:50 PM, Lolo Lolo wrote:
im working through alan's sql tutorial. i have a few questions from there but 
1st i wanted to try out an example in Core python's sql example.

import sqlite3
cxn = sqlite3.connect('sqlite_test/test')
cur = cxn.cursor()
after this i created a table called users and inserted some data. then i did:

cur.execute('SELECT * from users')
for user in cur.fetchall():
             print(user)

i got the results of all data i gave the table. then did

cur.close()
cxn.commit()
cxn.close()
i then closed this interactive IDLE session. i reopened another session and 
simply did

import sqlite3
cxn = sqlite3.connect('sqlite_test/test')
cur = cxn.cursor()
You are missing cur.execute('SELECT * from users')
for user in cur.fetchall():
             print(user)


--
Bob Gailer
919-636-4239
Chapel Hill NC

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to