Formatting output - simpler question

21 views
Skip to first unread message

jason

unread,
Feb 17, 2011, 11:15:23 PM2/17/11
to PyDbLite
Hi,

With the example below, what functions do I use to access and print
the keys and their associated values?


[{'City': 'Berlin', 'Fax': '030-0076545', 'CompanyName': 'Alfreds
Futterkiste', 'Country': 'Germany', 'Address': 'Obere Str. 57',
'Phone': '030-0074321', '__id__': 0, 'Postal Code': 12209,
'__version__': 0, 'CustomerID': 'ALFKI'}]


Jason

Pierre Quentel

unread,
Feb 18, 2011, 7:57:46 AM2/18/11
to PyDbLite
Hi,

Not sure how this is different from your other question, but if you
just want the keys and values without HTML formatting, you just do :

for record in record_list:
for (key,value) in record.iteritems():
print key,value

Hope this helps,
Pierre
Reply all
Reply to author
Forward
0 new messages