Implementing #define macros similar to C on python

Dave Angel davea at davea.name
Thu Nov 14 22:30:51 EST 2013


On Thu, 14 Nov 2013 18:29:48 -0800 (PST), JL <lightaiyee at gmail.com> 
wrote:
> One of my favorite tools in C/C++ language is the preprocessor 
macros.


> One example is switching certain print messages for debugging use 
only


> #ifdef DEBUG_ENABLE
> DEBUG_PRINT   print
> #else
> DEBUG_PRINT


> Is it possible to implement something similar in python? Thank you.

Sure. A preprocessor can be written for nearly every language. Are 
you offering?

-- 
DaveA




More information about the Python-list mailing list