IDLE - Customizing output format
ilias at lazaridis.com
Sun Oct 8 01:11:24 CEST 2006
Gabriel Genellina wrote:
> At Wednesday 27/9/2006 09:29, Ilias Lazaridis wrote:
> >import sys
> >def f(obj):
> > if obj:
> > print '::: ' + repr(obj)
> >sys.displayhook = f
> Have you tried that? You have to filter out None, not *any* False value.
> > > And notice that this replaces the output of *evaluated* expressions,
> > > not any print statement executed inside your code.
> >Any simple solution for this?
> Displaying things interactively is not the same as executing a print
> statement inside the code - I feel right they are not considered the
> same thing. print output goes to sys.stdout, you could replace it.
this is nicely described here:
do i need the "getattr" and "writeline" methods in MyStdOut?
More information about the Python-list