Hi All,

hi Joel,

Regarding sqlite3 practice code below:


   1. import sqlite3
   2. conn=sqlite3.connect("mydb2.db")
   3. c=conn.cursor()
   4. c.execute('create table family (Id integer primary key, name text,
   age integer)')
   5. c.execute("insert into family values (1,'elham',32)")
   6. c.execute('select * from family')
   7. conn.commit()
   8. for i in c:
   9.     print(i)


Why is it that if I call the for statement in the shell it doesn't print
the information more than once? I've found this to be true in other
situations where cursor carries the data only once. So, how can i
manipulate/use the data if I can only access it once? I have tried applying
useing x=list(c), but it doesn't seem to work!

Any guidance?

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

Reply via email to