Skip to content

Instantly share code, notes, and snippets.

@ninehills
Forked from EdwardBetts/pprint_color.py
Last active August 29, 2015 14:22
Show Gist options
  • Save ninehills/e18db151ad3c748a6a9f to your computer and use it in GitHub Desktop.
Save ninehills/e18db151ad3c748a6a9f to your computer and use it in GitHub Desktop.
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import Terminal256Formatter
from pprint import pformat
def pprint_color(obj):
print highlight(pformat(obj), PythonLexer(), Terminal256Formatter())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment