pyppin.file.tee

[View Source]

An io.IOBase that lets you tee writes to multiple file targets.

Functions

tee(*files)

Given a collection of writable file-like objects, return a single file-like object, so that a write to that central object will be fanned out to all the passed ones.

Classes

RawTee(*children)

Tee

TextTee(*children)

pyppin.file.tee.tee(*files: Union[RawIOBase, BufferedIOBase, TextIOBase]) Union[RawIOBase, BufferedIOBase, TextIOBase][source]

Given a collection of writable file-like objects, return a single file-like object, so that a write to that central object will be fanned out to all the passed ones.

One sample use of this is to pass it to subprocess.Popen, so that you can both capture and print stdout.