dictionary = {'someKey' : 'someValue'}
file_path = 'somePathToFile/someFileName.py'
with open(file_path, 'w') as output_file:
print(dictionary, file=output_file)
# Writing dictionary as json
import json
d = {'guitar':'Jerry', 'drums':'Mickey' }
json.dump(d, open('1.json', 'w'))
# Reading dictionary from a json file
json.load(open('1.json', 'r'))