Created
April 7, 2021 16:14
-
-
Save antonga23/83d4ce6daa5438366525e77e98849634 to your computer and use it in GitHub Desktop.
pretty print json
This file contains hidden or 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
def write_json(): | |
result = {} #some random json | |
with open('data.json', 'w', encoding='utf-8') as f: | |
json.dump(result, f, ensure_ascii=False, indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment