How to catch python's STDOUT

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Thu Apr 6 05:59:02 EDT 2006


praveenkumar.117 at gmail.com enlightened us with:
> I have python script in which i have some print statements.  I dont
> want the outputs of print to be displayed on the console since it is
> used my fellow-workers But i need those prints for debugging purpose
> So some how i want to capture those prints can u please suggest

I suggest you remove the print statements and start using the logging
module instead. It's much more powerful, and allows you to put debug
statements in a file, for instance.

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
                                             Frank Zappa



More information about the Python-list mailing list