giant.utilities.teeΒΆ

This module provides 2 classes for performing tees of outputs to a file.

A tee (in unix terminology) refers to the ability to pipe 1 input to multiple outputs. Here that means we can pipe a single call to stderr or stdout to write to both the standard stderr/stdout, as well as a user specified file. This is useful for logging an interactive program (where you want to print both to the screen and to a file).

The Tee class is used to tee either STDOUT or STDERR to a file, while the DoubleTee class is used to tee both STDOUT and STDERR to the same file. Both of these classes can be used as context managers.

Classes

REDIRECT

An enumeration specifying the options of what to redirect

Tee

This class support simultaneously writing to a file and stdout/stderr

DoubleTee

This class provides the ability to simultaneously tee both STDOUT and STDERR to a file.