I store JSON data as a string (comming from json.dumps()
) to files. But complexe data is not readable for humans because linebreaks and indents are missing.
>>> import json
>>> d = {'one': 1, 'group': [4,9,7]}
>>> json.dumps(d)
'{"one": 1, "group": [4, 9, 7]}'
But the string should look more like this.
{'one': 1,
'group': [
4,
9,
7
]
}
Can I realize this?