redirecting output

Bill Scherer Bill.Scherer at
Fri Feb 2 06:46:15 CET 2001

look at the docs for the sys module.  You can redirect sys.stdout (and
sys.stderr and sys.stdin) to any sutable object...

Jp Calderone wrote:
>   I've attached the python interpreter to a server,
> essentially letting people connect to the given address
> and port and pump stuff into it.  What I can't figure out
> is how I might go about redirecting the output from some
> of the builtin functions - dir(), print, etc, to their
> socket.  Is this possible?
>  Thanks in advance,
>    Jp
> --

William K. Scherer
Sr. Member of Applications Staff - Verizon Wireless

More information about the Python-list mailing list