Select as dictionary...

Besturk.Net Admin besturk at gmail.com
Mon Oct 1 15:32:07 CEST 2007


Hi..
I am using python with postgresql.
And i have a query :

aia.execute("SELECT id, w from list")
links=aia.fetchall()
print links

and result
[(1, 5), (2,5).......] (2 million result)

I want to see this result directly as a dictionary:

{1: 5, 2: 5 .....}

How do i select in this format ?

I'm sorry my bad english.

 King Regards...




More information about the Python-list mailing list