use json dump in pyton to write dictionary to file code example
Example: save a dict to json python
import json
with open('data.json', 'w') as fp:
json.dump(data, fp)
import json
with open('data.json', 'w') as fp:
json.dump(data, fp)