Re: conditional print statement ?

2007-04-27 Thread stef
or (untested): if Print_Info: def printOrNot(arg): print arg else: def printOrNot(arg): pass printOrNot(Datafile.readline()) thanks for the creative solution, and indeed it does work ;-) cheers, Stef Mientki --

Re: conditional print statement ?

2007-04-27 Thread Paul McGuire
On Apr 26, 7:31 am, Dustan [EMAIL PROTECTED] wrote: On Apr 26, 1:58 am, Antoon Pardon [EMAIL PROTECTED] wrote: On 2007-04-25, Stef Mientki [EMAIL PROTECTED] wrote: hello, As part of a procedure I've a number sequences like this: Python if Print_Info: print

Re: conditional print statement ?

2007-04-27 Thread Duncan Booth
Paul McGuire [EMAIL PROTECTED] wrote: The Enable/Disable decorators on the Python wiki (http:// wiki.python.org/moin/PythonDecoratorLibrary?highlight=%28decorator %29#head-8298dbf9ac7325d9ef15e7130e676378bbbda572) help you do something very similar, without having to replicate the function

Re: conditional print statement ?

2007-04-27 Thread Paul McGuire
On Apr 27, 9:45 am, Duncan Booth [EMAIL PROTECTED] wrote: Paul McGuire [EMAIL PROTECTED] wrote: The Enable/Disable decorators on the Python wiki (http:// wiki.python.org/moin/PythonDecoratorLibrary?highlight=%28decorator %29#head-8298dbf9ac7325d9ef15e7130e676378bbbda572) help you do

Re: conditional print statement ?

2007-04-26 Thread Antoon Pardon
On 2007-04-25, Stef Mientki [EMAIL PROTECTED] wrote: hello, As part of a procedure I've a number sequences like this: Python if Print_Info: print Datafile.readline() else:Datafile.readline() /Python Is there a more compressed way to write such a statement,

Re: conditional print statement ?

2007-04-26 Thread stef
Antoon Pardon wrote: On 2007-04-25, Stef Mientki [EMAIL PROTECTED] wrote: hello, As part of a procedure I've a number sequences like this: Python if Print_Info: print Datafile.readline() else:Datafile.readline() /Python Is there a more compressed way to

Re: conditional print statement ?

2007-04-26 Thread Dustan
On Apr 26, 1:58 am, Antoon Pardon [EMAIL PROTECTED] wrote: On 2007-04-25, Stef Mientki [EMAIL PROTECTED] wrote: hello, As part of a procedure I've a number sequences like this: Python if Print_Info: print Datafile.readline() else:Datafile.readline() /Python

conditional print statement ?

2007-04-25 Thread Stef Mientki
hello, As part of a procedure I've a number sequences like this: Python if Print_Info: print Datafile.readline() else:Datafile.readline() /Python Is there a more compressed way to write such a statement, especially I dislike the redundancy Datafile.readline().

Re: conditional print statement ?

2007-04-25 Thread Martin v. Löwis
Stef Mientki schrieb: hello, As part of a procedure I've a number sequences like this: Python if Print_Info: print Datafile.readline() else:Datafile.readline() /Python Is there a more compressed way to write such a statement, especially I dislike the

Re: conditional print statement ?

2007-04-25 Thread Terry Reedy
Stef Mientki [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | if Print_Info: print Datafile.readline() | else:Datafile.readline() Since both branches discard the data read, I presume Martin's fix is what you really want. | Is there a more compressed way to