I just googled the OP's question and found a StackOverflow question.
That question's solution mentions pypreprocessor.
On 6 August 2012 08:20, Steven W. Orr ste...@syslang.net wrote:
On 8/5/2012 12:43 AM, Ramchandra Apte wrote:
Try pypreprocessor
Serhiy Storchaka storch...@gmail.com writes:
On 05.08.12 09:30, Steven D'Aprano wrote:
If you are working in a tight loop, you can do this:
if VERBOSE_FLAG:
for item in loop:
print(DEBUG_INFORMATION)
do_actual_work(item)
else:
for item in loop:
On 06.08.12 20:02, Dieter Maurer wrote:
Serhiy Storchaka storch...@gmail.com writes:
On 05.08.12 09:30, Steven D'Aprano wrote:
If you are working in a tight loop, you can do this:
if VERBOSE_FLAG:
for item in loop:
print(DEBUG_INFORMATION)
do_actual_work(item)
else:
On Sat, 04 Aug 2012 21:16:04 -0700, JW Huang wrote:
Hi,
How can I implement something like C++'s conditional compile.
if VERBOSE_MODE: print debug information else: do nothing
But I don't want this condition to be checked during runtime as it will
slow down the code.
You've profiled
On 05.08.12 09:30, Steven D'Aprano wrote:
If you are working in a tight loop, you can do this:
if VERBOSE_FLAG:
for item in loop:
print(DEBUG_INFORMATION)
do_actual_work(item)
else:
for item in loop:
do_actual_work(item)
Or this:
if VERBOSE_FLAG:
def
On 8/5/2012 12:43 AM, Ramchandra Apte wrote:
Try pypreprocessor http://code.google.com/p/pypreprocessor/ .
Better idea:
You should be using the logging http://docs.python.org/library/logging.html
module if you want to print debug information quickly.It uses threads and is
optimized to run fast.
Hi,
How can I implement something like C++'s conditional compile.
if VERBOSE_MODE: print debug information
else: do nothing
But I don't want this condition to be checked during runtime as it
will slow down the code.
Thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list
Try pypreprocessor http://code.google.com/p/pypreprocessor/ .
Better idea:
You should be using the
logginghttp://docs.python.org/library/logging.htmlmodule if you want
to print debug information quickly.It uses threads and
is optimized to run fast.
On 5 August 2012 09:46, JW Huang