IDLE - Customizing output format

Ilias Lazaridis ilias at lazaridis.com
Tue Sep 26 14:31:37 EDT 2006


Gabriel Genellina wrote:
> At Sunday 24/9/2006 18:55, Robert Kern wrote:
>
> >Anyways, against my better judgement, I will tell you that you can
> >customize the
> >output by replacing sys.displayhook with your own function:
> >
> >    http://www.python.org/doc/current/lib/module-sys.html
> >
> >  >>> import sys
> >  >>> def f(obj):
> >         print '    ' + repr(obj)
> >  >>> sys.displayhook = f
>
> Sometimes I enable a similar approach on my sitecustomize.py, using
> the pprint module. But I don't *always* like the output format.

Can you please show this approach using "pprint"?

.




More information about the Python-list mailing list