📜  文件中的多个 json 记录 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:55.777000             🧑  作者: Mango

代码示例1
import json

studentsList = []
print("Started Reading JSON file which contains multiple JSON document")
with open('students.txt') as f:
    for jsonObj in f:
        studentDict = json.loads(jsonObj)
        studentsList.append(studentDict)

print("Printing each JSON Decoded Object")
for student in studentsList:
    print(student["id"], student["name"], student["class"], student["email"])