[python-win32] python print statements

David Robinow drobinow at gmail.com
Thu Jan 8 20:36:11 CET 2009


On Thu, Jan 8, 2009 at 1:12 PM, Nalli Dinesh <nalli.dinesh at gmail.com> wrote:
> I do not want to remodel my application at this stage. I have print
> statements all over the place. I looking at a solution where, without
> touching the print statements at all, I want to tell the python interpreter
> to not execute print statements inside my application, when the application
> is running. Like, is there a way to tell the Python interpreter do not
> bother to execute print lines in my application. Or is there a way to just
> define a python builtin variable which dictates executing print statements
> or not.

1) If you find eliminating or modifying all your print statements to
be onerous, you
really need to look at the tools you are using. This should not take
more than a few
minutes of your time.

2) You can redirect all your output by redirecting to the null device.
If you run from a command line or a batch file, just add  "> NL:" to
the end of your
command.
 If you run from a shortcut, add it to your Target: box.


More information about the python-win32 mailing list