how to read in a list of json code example
Example 1: how to retrieve the list value of json file in python
json_data = [] # your list with json objects (dicts)
for item in json_data:
for data_item in item['data']:
print data_item['name'], data_item['value']
Example 2: how to retrieve the list value of json file in python
for key, value in json_data.iteritems():
print key
if isinstance(value, (list, tuple)):
for item in value:
print item
if isinstance(value, (dict)):
for value_key,value_value in value.iteritems():
print value_key,str(value_value)