Newbie: Capture output of compile_dir

Denis S. Otkidach ods at fep.ru
Tue Jul 16 08:23:34 EDT 2002


On Tue, 16 Jul 2002, Peter Hansen wrote:

PH> By the way, "sys" has _stdout and _stderr already, which I
PH> believe
PH> point to the originals, so I believe you don't need to
PH> preserve
PH> these in your own locals unless you're expecting to have to
PH> nest
PH> these sorts of redirections.

Certainly, sys module have __stdout__ and __stderr__.  But we
should restore values being before our definition.  For instance
if I have colored python shell with already redefined
sys.std{out|err} to add ANSII escape sequences then falling back
to __std{out|err}__ will break this.

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]
http://diveinto.python.ru/ [ru]






More information about the Python-list mailing list