how to format json file in python code example
Example 1: save json file python
with open('data.txt', 'w') as outfile:
json.dump(data, outfile)
Example 2: python format json file
python3 -m json.tool unformatted.json > formatted.json
with open('data.txt', 'w') as outfile:
json.dump(data, outfile)
python3 -m json.tool unformatted.json > formatted.json