📌  相关文章
📜  python 加载具有多个 json 的文件 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:44.937000             🧑  作者: Mango

代码示例1
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 ...