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
--
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
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
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
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,
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
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
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().
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
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
10 matches
Mail list logo