What is print? A function?
fredrik at pythonware.com
Sun Jan 23 13:33:58 EST 2005
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:
def write(self, text):
sys.stdout = dev_null()
or pipe all print requests to a debug stream:
debug = sys.stdout
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"
More information about the Python-list