Skip to content

Instantly share code, notes, and snippets.

@minrk
Created November 30, 2013 04:02
Show Gist options
  • Save minrk/7715212 to your computer and use it in GitHub Desktop.
Save minrk/7715212 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Naereen
Copy link

Naereen commented Jun 20, 2017

Using this piece of code instead:

from __future__ import print_function
from IPython.core import page
def myprint(s):
    try:
        print(s['text/plain'])
    except (KeyError, TypeError):
        print(s)
page.page = myprint

allow the text to be displayed with nice colors, if available.
See:
demo_gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment