On Jun 27, 7:40 pm, XiaQ <[EMAIL PROTECTED]> wrote:
> I need to build a stream that writes to stdout and a file at the same
> time. Is there already a function in the Python library to do this?


class FileAndStdout(file):
    def write(self, data):
        file.write(self, data)
        sys.stdout.write(data)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to