I have a json file with a dictionary, and lists inside that dictionary
{"Dogs": [["spot"], 1], "Cats": [["whiskers"], 1], "fish": [["bubbles", "lefty", "tank", "goldie"], 4], "elephant": [["tiny", "spring"], 2], "zebra": [[], 1], "gazelle": [["red", "blue", "green", "yellow", "gold", "silver"], 6]}
There's more in the dictionary but from this example you can see the format.
with open('myfile.json', 'r') as myfile:
json_data = json.load(myfile)
for e,([v], z) in json_data.items():
print e, v, z
This gives me a
too many values to unpack error.
I want the output to look like
dogs spot 1
cats whiskers 1