A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/106711.html below:

getting Gadfly data into a list

getting Gadfly data into a listLee 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4