I would like to save a list of python dicts A into a JSON file B. I used
json.dump(A, B)
to do that. But the saved JSON file's format is like
[{'a': 1, 'b': 1}, {'a':2, 'b':2}...]
What I want the display is to be something like:
[
{'a': 1, 'b': 1},
{'a': 2, 'b': 2},
...
],
so that others can easily read. Is there a way to do that?