Skip to content

How to create text file with Python and store a dictionary?

import json

Dict = {'Dict': Dict}

with open('file.txt', 'w') as file:
     file.write(json.dumps(Dict))
See also  Python code snippet - How to find lowest number in list ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.