Answers for "multiple json records in a file"

0

multiple json records in a file

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"])
Posted by: Guest on August-28-2021

Code answers related to "multiple json records in a file"

Code answers related to "Javascript"

Browse Popular Code Answers by Language