What is print? A function?
Nelson Minar
nelson at monkey.org
Sun Jan 23 16:35:33 EST 2005
Frans Englich <frans.englich at telia.com> writes:
> The reason I thinks about this is I need to implement a debug print for my
> program; very simple, a function/print statement that conditionally prints
> its message whether a bool is true. Not overly complex.
As several folks have said, print is a statement, and Python doesn't
really let you add statements to the language.
You said you wanted to build a simple debugging function, so maybe
this doesn't fit the bill, but for bigger pieces of code Python has a
nice logging library. It's something like log4j or java.util.logging.
http://www.python.org/doc/2.4/lib/module-logging.html
More information about the Python-list
mailing list