IDLE - Customizing output format

Robert Kern robert.kern at gmail.com
Sun Sep 24 17:55:54 EDT 2006


Ilias Lazaridis wrote:
> Steve Holden wrote:

>> And I am wondering at your continual surprise when the rest of the world
>> fails to share your perceptions. Doesn't this carry *any* information?
> 
> not the rest of the world, but the rest of the python community.

Remember back when you first came to comp.lang.python and I told you that this 
was not the community that you were looking for?

   http://mail.python.org/pipermail/python-list/2005-February/266629.html

Good times.

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
 >>> 1
1
 >>> def f(obj):
	print '    ' + repr(obj)

	
 >>> sys.displayhook = f
 >>> 1
     1
 >>>

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list