json datatype python code example
Example 1: python json dump to file
import json
with open('data.json', 'w') as f:
json.dump(data, f)
Example 2: response.json results in pretty data python
import requests
import json
r = requests.get('http://server.com/api/2/....')
pretty_json = json.loads(r.text)
print (json.dumps(pretty_json, indent=2))