How can I 'compound' streams?

Dan Bishop danb_83 at
Thu Jun 28 03:20:47 CEST 2007

On Jun 27, 7:40 pm, XiaQ <hn_sd_ywx_x... at> 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)

More information about the Python-list mailing list