Created
February 1, 2019 13:37
-
-
Save jeakwon/201284754ff206a80ebedbdd70b5afca to your computer and use it in GitHub Desktop.
python save dict as json file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def to_json(dictionary, filename): | |
with open(filename,'w') as fp: | |
json.dump(dictionary, fp,sort_keys=True, indent=4,ensure_ascii=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment