Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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 ...
Source by pynative.com #
 
PREVIOUS NEXT
Tagged: #python #load #file #multiple #jsons
ADD COMMENT
Topic
Name
1+6 =