Well, you can't keep Python from _executing_ the print statements, but
you can keep it from displaying the results.
Any python object which has a "write" method can be used as target for
the "print" statement, so...
def test(n):
for i in range(n):
print 'I is =', i
class blackHole(obj
On Thu, Jan 8, 2009 at 1:12 PM, Nalli Dinesh 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 sta
sh
> Sent: 08 January 2009 18:13
> To: Vernon Cole; jim.vick...@noaa.gov
> Cc: python-win32@python.org
> Subject: Re: [python-win32] python print statements
>
> Thanks Vernon, Jim, Micheal.
>
> I kind of knew the different ways of modelling any python
> appli
Thanks Vernon, Jim, Micheal.
I kind of knew the different ways of modelling any python application as you
guys have described in your email. I appreciate your inputs though. But I am
looking for a different solution.
Here is what I am looking at -
I do not want to remodel my application at this
How about --
if debug: print x
or, in a more complex setting, have a "verbose" attribute in each module and --
if self.verbose > 2: print x # so you can have levels of debug printouts
??
--
Vernon Cole
On Wed, Jan 7, 2009 at 11:30 PM, Michel Claveau wrote:
> Hi!
>
> 1) Define your print fun
Hi!
1) Define your print function. Example:
def mprint(*par):
for i in par:
print i,
print
2) in your code, replace all 'print' by 'mprint'
3) when you want cancel the print, modify only the mprint function.
@-salutations
--
Michel Claveau
_
Nalli Dinesh wrote:
Hi,
python print statements are extensively used in my application for
debugging purpose. My application is ready, but I do not want to
remove the print statements and at the same time I do not want python
interpreter to execute/run the print statements. How can I accompl
Hi,
python print statements are extensively used in my application for debugging
purpose. My application is ready, but I do not want to remove the print
statements and at the same time I do not want python interpreter to
execute/run the print statements. How can I accomplish this scenario.
Thanks