I am trying to pretty print a dict in Jupyter Notebook.
I am using the following:
import pprint
stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni']
stuff.insert(0, stuff[:])
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(stuff)
However upon pressing shift+enter, no [out]
cell appear (i.e. I can't see the pretty printed output)
Any idea why this is so/ what should I change in order to see the pretty printed output?
Edit: Actually this is a python 2.7 problem - it works fine in 3.x. Have anyone tried it on python 2.7 and seen it work?