Frans Englich wrote:
> I find this a nice solution. The most practical would be if it was possible to
> do this with print, of course. But print won't budge.
you can disable print, though:
class dev_null:
def write(self, text):
pass
sys.stdout = dev_null()
or pipe all print requests to a debug stream:
if my_debug_flag:
debug = sys.stdout
else:
debug = dev_null()
print >>debug, "hello"
print >>debug, "the value is", value
> Is it possible to create own statements, such that it would be possible to do:
>
> printDebug "test"
no.
</F>
--
http://mail.python.org/mailman/listinfo/python-list