save a dict to json python
snippet in javascript

save a dict to json python

user5053

import json

with open('data.json', 'w') as fp:
    json.dump(data, fp)