Skip to content

Instantly share code, notes, and snippets.

@antonga23
Created April 7, 2021 16:14
Show Gist options
  • Save antonga23/83d4ce6daa5438366525e77e98849634 to your computer and use it in GitHub Desktop.
Save antonga23/83d4ce6daa5438366525e77e98849634 to your computer and use it in GitHub Desktop.
pretty print json
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