How can I iterate through and extract values from the following list, the code I am using below only gets the key values.
> [{'filename': <docxtpl.InlineImage object at 0x040038D0>, 'desc':
> u'dfgdgfdfg'}, {'filename': <docxtpl.InlineImage object at
> 0x04014930>, 'desc': u'dfgdfgdfg'}, {'filename': <docxtpl.InlineImage
> object at 0x04014A90>, 'desc': u'fghfghfh'}]
Code:
for k,v in audit_items_list:
print audit_items_list
print k
print v
If I use k.value(). I get the following error :
AttributeError: 'str' object has no attribute 'values'
Update: Thanks for all the help, but i actually want to grab the values of filename and desc on each iteration...
audit_items_lista{}or[{}]? Did you tryiteritems()?