Answers for "python load file with multiple jsons"

0

python load file with multiple jsons

import json
json_list = []
print("Started Reading JSON file which contains multiple JSON document")
with open('your_file_with_multiple_jsons.extention') as f:
    for json_obj in f:
        a_dict = json.loads(json_obj)
        json_list.append(a_dict)

print("Printing each JSON Decoded Object")
for js in json_list:
    print(js["key1"]) # key2, key3 ...
Posted by: Guest on September-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language