(class from pyomo.common.tee)
pyomo.common.tee
Bases: object
object
Redirect a file descriptor to a new file or file descriptor.
This context manager will redirect the specified file descriptor to a specified new output target (either file name or file descriptor). For the special case of file descriptors 1 (stdout) and 2 (stderr), we will also make sure that the Python sys.stdout or sys.stderr remain usable: in the case of synchronize=True, the sys.stdout / sys.stderr file handles point to the new file descriptor. When synchronize=False, we preserve the behavior of the Python file object (retargeting it to the original file descriptor if necessary).
fd (int) – The file descriptor to redirect
output (int or str or None) – The new output target for fd: either another valid file descriptor (int) or a string with the file to open. If None, then the fd is redirected to os.devnull.
synchronize (bool) – If True, and fd is 1 or 2, then update sys.stdout or sys.stderr to also point to the new file descriptor
Methods
__init__([fd, output, synchronize])
__init__
Member Documentation