Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable pretty printing by default in IPython

How do I enable pretty printing by default in IPython? I haven't been able to find clear instructions anywhere on how to do this. Thanks much!

like image 565
Julian A. Avatar asked Feb 19 '13 22:02

Julian A.


People also ask

How do I turn off pretty-print in Python?

If you want to turn off pprint permanently, make a profile, and add c. PlainTextFormatter. pprint = False to the profile file.

How do I enable Pprint?

To use pprint, begin by importing the library at the top of your Python file. From here you can either use the . pprint() method or instantiate your own pprint object with PrettyPrinter() .

What is Pprint Pprint?

The pprint module provides a capability to “pretty-print” arbitrary Python data structures in a form which can be used as input to the interpreter. If the formatted structures include objects which are not fundamental Python types, the representation may not be loadable.


1 Answers

$ ipython help notebook | grep pprint -A1
--pprint
    Enable auto pretty printing of results.
--
--no-pprint
    Disable auto auto pretty printing of results.


$ ipython help console | grep pprint -A1
--pprint
    Enable auto pretty printing of results.
--
--no-pprint
    Disable auto auto pretty printing of results.
like image 113
David Avatar answered Sep 22 '22 11:09

David