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!
If you want to turn off pprint permanently, make a profile, and add c. PlainTextFormatter. pprint = False to the profile file.
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() .
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.
$ 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With