[newbie] Right way to access item in array?

Gilles Ganault nospam at nospam.com
Tue Oct 28 10:11:18 EDT 2008


On Tue, 28 Oct 2008 12:12:26 +0100, Gerhard Häring <gh at ghaering.de>
wrote:
>You can do it even in one step with APSW (and pysqlite, and others):
>
>for isbn, price in cur.execute("select isbn, price ..."):

Thanks much guys. For those interested, here's some working code:

======
import apsw

connection=apsw.Connection("mybooks.sqlite")
cursor=connection.cursor()

for id, isbn in list(cursor.execute("SELECT id,isbn FROM books WHERE
price IS NULL")):

	print isbn

connection.close(True)
======

HTH,



More information about the Python-list mailing list