Parsing Python dictionary with multiple objects
rustompmody at gmail.com
Wed Oct 15 18:43:06 CEST 2014
On Wednesday, October 15, 2014 9:58:49 PM UTC+5:30, Anurag Patibandla wrote:
> First the values printed by
> '[(queues[j], json.get(queues[j])) for j in range(len(queues))] '
> is a list, so I tried to convert it into a dict using dict().
> And then I tried doing dict but there is an error which says:
> 'type' object has no attribute '__getitem__'
print each step in the process until the error step
[(queues[j], json.get(queues[j])) for j in range(len(queues))]
is the same as
[(q, json.get(q) for q in queues]
a = [(q, json.get(q) for q in queues]
b = dict(a)
c = b
or whatever it is you are doing
and PASTE (not NARRATE) the results
More information about the Python-list