Re: [Tutor] ifdef in python

2009-10-24 Thread Albert-Jan Roskam
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"

Re: [Tutor] ifdef in python

2009-10-21 Thread Wayne
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(): >#

Re: [Tutor] ifdef in python

2009-10-21 Thread Lie Ryan
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

Re: [Tutor] ifdef in python

2009-10-21 Thread Kent Johnson
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

[Tutor] ifdef in python

2009-10-21 Thread Lizhi Yang
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