import json
with open('settings.json', 'w') as f:
    f.write(json.dumps(settings))
with open('settings.json', 'r') as f:
    settings = json.load(f)
Python - How do I make a dictionary inside of a text file?