On Feb 14, 5:10 pm, "goodwolf" <[EMAIL PROTECTED]> wrote: > like this? > > class Writers (object): > > def __init__(self, *writers): > self.writers = writers > > def write(self, string): > for w in self.writers: > w.write(string) > > def flush(self): > for w in self.writers: > w.flush(): > > import sys > > logfile = open('log.txt', 'w') > sys.stdout = Writers(aya.stdout, file('log.out', 'w'), logfile) > sys.stderr = Writers(aya.stdout, file('log.err', 'w'), logfile)
i've tried simliar methods to this and to what Matimus wrote. I know it works great when using print statements. However, I'm looking to find something that will work with the output from a subprocess, such as from spawn, os.system, os.popen, etc. -- http://mail.python.org/mailman/listinfo/python-list