Skip to content

Instantly share code, notes, and snippets.

@coltenkrauter
Created November 7, 2022 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coltenkrauter/2e3113ee63d13a800d7693988e9cdc6d to your computer and use it in GitHub Desktop.
Save coltenkrauter/2e3113ee63d13a800d7693988e9cdc6d to your computer and use it in GitHub Desktop.
Python | Pretty print dict as JSON
import json
# default=str is useful since it will cast certain objects to string that otherwise aren't json parsable, such as datetime dates.
print(json.dumps(domains, indent=4, sort_keys=True, default=str))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment