Skip to content

Instantly share code, notes, and snippets.

/example.py Secret

Created October 10, 2017 05:54
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 anonymous/c6ee1be4befc1c38d34cd02553b31945 to your computer and use it in GitHub Desktop.
Save anonymous/c6ee1be4befc1c38d34cd02553b31945 to your computer and use it in GitHub Desktop.
import builtins
import functools
import json
orig_print = builtins.print
def indent4(f):
@functools.wraps(f)
def wrapped(*args, **kwargs):
return f(json.dumps(*args, **kwargs, indent=4))
return wrapped
@indent4
def print(*args, **kwargs):
return orig_print(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment