their shoes, that way
when you do criticize them, you're a mile away and you have their shoes!
~~
--- On Wed, 10/21/09, Wayne wrote:
> From: Wayne
> Subject: Re: [Tutor] ifdef in python
> To: "Lie Ryan"
On Wed, Oct 21, 2009 at 3:29 PM, Lie Ryan wrote:
> Lizhi Yang wrote:
>
>> Is there anything similar to ifdef statement in C or C++ in python?
>>
>
> Not really, but python's regular if can be used for a similar purpose:
>
> DEBUG = True
>
> if DEBUG:
>import logging
>def foo():
>#
Lizhi Yang wrote:
Is there anything similar to ifdef statement in C or C++ in python?
Not really, but python's regular if can be used for a similar purpose:
DEBUG = True
if DEBUG:
import logging
def foo():
# debug version
else:
def foo():
# normal version
def main
On Wed, Oct 21, 2009 at 3:26 PM, Lizhi Yang wrote:
> Is there anything similar to ifdef statement in C or C++ in python?
No, Python doesn't have a preprocessor. Can you say why you want it?
You may be able to do what you want using an ordinary if statement,
for example you can conditionally impor
Is there anything similar to ifdef statement in C or C++ in python?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor