getting Gadfly data into a list
Lee Joramo
lee at joramo.com
Tue Apr 24 09:28:04 EDT 2001
I have set up a small database using gadfly. Is there a way to directly pull
query results into a list? Currently the only way that I have found to
access the data is by using "cursor.pp()". But this displays a nicely
formatted table that is difficult to use for anything.
For example, I have the following:
>>>cursor.execute('select * from MyTable')
>>>print cursor.pp()
MY_INTEGER | MY_FLOAT | MY_STRING
==================================
1 | 3.13 | abc
2 | 5.23425 | 345
3 | 10.23423 | green frog
I would like to do something like:
>>>a = cursor.LIST_RESULTS()
>>>print a
[[1, 3.13, 'abc'], [2, 5.23425, "abc"], [3, 10.23423, "green frog"]]
TIA,
Lee Joramo
lee.list at joramo.com
More information about the Python-list
mailing list