redirect stdout

Joshua Ginsberg listspam at flowtheory.net
Fri Apr 8 13:04:56 EDT 2005


Use *NIX magic. Make a named pipe to a python program that pushes stdin 
to syslog and when you execute your program, redirect stdout to the 
named pipe.

-jag

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Pasted Graphic.tiff
Type: image/tiff
Size: 17326 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050408/35c99830/attachment.tiff>
-------------- next part --------------

Joshua Ginsberg -- joshg at brainstorminternet.net
Brainstorm Internet Network Operations
970-247-1442 x131
On Apr 8, 2005, at 10:52 AM, Neal Becker wrote:

> I'd like to build a module that would redirect stdout to send it to a 
> logging
> module.  I want to be able to use a python module that expects to print
> results using "print" or "sys.stdout.write()" and without modifying 
> that
> module, be able to redirect it's stdout to a logger which will send the
> messages via datagrams to a server.
>
> Any ideas?
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>


More information about the Python-list mailing list