[newbie] Right way to access item in array?

Gilles Ganault nospam at nospam.com
Tue Oct 28 10:13:14 EDT 2008


On Tue, 28 Oct 2008 09:56:11 -0400, Steve Holden <steve at holdenweb.com>
wrote:
>If you are dealing with a DB API-compliant module then the return value
>from the cursor's execute method is undefined, and you need to call one
>of the "fetch" methods to extract the retrieved data.

Thanks for pointing it out. I read that calling list() on the dataset
is the way to go with this module:

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



More information about the Python-list mailing list