Mimic C preprocessor with Python/Ruby?
Posted
by prosseek
on Stack Overflow
See other posts from Stack Overflow
or by prosseek
Published on 2010-04-21T16:24:31Z
Indexed on
2010/04/21
16:33 UTC
Read the original article
Hit count: 293
I need to mimic the preprocessor feature of C with Python.
If I want to run the debug release, I use as follows with C
#ifdef DEBUG
printf(...)
#endif
I just use -DDEBUG or similar to trigger it on or off.
What method can I use for Python/Ruby? I mean, what should I do to control the behavior of python/ruby scripts in such a way that I can change a variable that affects all the script files in a project?
© Stack Overflow or respective owner