[Solved] How to fix ‘\n’ from json?

[ad_1]

Assuming your data object is a simple dict or list,all you need to do is:

with open(output_path, 'w') as f:
    json.dump(data, f, sort_keys=True, indent=4)

This will correctly dump to the output file.

3

[ad_2]

solved How to fix ‘\n’ from json?