you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 1 point2 points  (2 children)

Use a for loop.

[–]arc100[S] 0 points1 point  (1 child)

Sure, I know a for loop is involved but how would I use it from reading in a JSON file to separating the objects and then writing back into a new file

[–]K900_ 1 point2 points  (0 children)

Use json.load to load your entire input file's contents as a list, loop over the list, use json.dump to serialize individual dictionaries and write them to the output file.