Enable pretty printing by default in IPython
Asked Answered
P

1

8

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!

Promisee answered 19/2, 2013 at 22:20 Comment(4)
It's enabled by default in ubuntu. What are you using?Clyburn
This forum thread had the same issue as you. I would check it out!Sinuosity
Do you just want the Out [123]: lines in IPython to do the equivalent of pprint.pprint(_) instead of print(repr(_)), or do you want to hook every call to print to pprint.pprint instead, or something like that?Tsarism
Or… if you just want %pprint enabled by default, that's just a config setting—and it's already enabled by default, unless you changed something. (At least if you pip install ipython, or install the RPM/DEB/port/etc. on any system I've used, it's enabled by default; it's always possible that some platform/distro does things differently.)Tsarism
T
5
$ 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.
Temperature answered 15/5, 2013 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.