Intercept and Tag STDOUT values
Wes S.
MornIHATESPAMThdr at NOSPAMverizon.net
Wed Oct 13 00:06:54 EDT 2004
Ok, so I've solved one piece of the puzzle, now the class itself works
(errors...sad...). Nevertheless, it's not actually replacing the sys.stdout
like I have intended all along...
class cStdOutRedirect :
stdOld = sys.stdout
def __main__(self) :
self.stdOld = sys.stdout
sys.stdout = self
return True
def write(self,str) :
self.stdOld.write("REDIRECTED OUTPUT: " + str)
return True
def close(self) :
sys.stdout = self.stdOld
return True
More information about the Python-list
mailing list