Код: Выделить всё
[{'test1': True, 'test2': [0, 1, 2], 'test3': None}]
Код: Выделить всё
# heading, new newline here, it assigns the list to variable "a"
import json
a =
# trailing
with open('json-dump', 'w') as f:
for row in a:
f.write(json.dumps(row) + '\n')
Это есть ли лучший способ сделать это?
Подробнее здесь: https://stackoverflow.com/questions/783 ... json-loads