import json  Dict = {'Dict': Dict}  with open('file.txt', 'w') as file:      file.write(json.dumps(Dict))

Read more of this post