Extract part of data from JSON file with python [duplicate]
This question already has an answer here: Access a particular field in arbitrarily nested JSON data [duplicate] 3 answers I have been trying to extract only certain data from a JSON file. I managed to decode the JSON and get the wanted data into a python dict. When I print out the dict it shows all the wanted data, but when I try to write the dict into a new file, only the last object gets written. One thing that I can't understand is also why when I print the dict I get multiple dicts objects instead of 1 as I would expect. My code: import json input_file=open('json.json', 'r') output_file