AlbertUnruhUtils.utils.capturing module¶
- class AlbertUnruhUtils.utils.capturing.STDCopy(std: Literal['in', 'out', 'err', 'stdin', 'stdout', 'stderr'], *args, **kwargs)¶
Bases:
TextIOWrapperCaptures
sys.std*.Usage¶
You can either set the
sys.std*-attribute to this class, or you can use it inside awith-statements, which will then capture just inside the statement.- captured¶
Everything which got captured.
- Type
str
Notes
stdin(orin) doesn’t work at the moment and will raise anEOFError.- param std
The sys.std* to capture.
- type std
_STD
- param args
args and kwargs for TextIOWrapper
- type args
…
- param kwargs
args and kwargs for TextIOWrapper
- type kwargs
…
- captured: str¶
- write(s)¶
Write string to stream. Returns the number of characters written (which is always equal to the length of the string).
- read(size=-1)¶
Read at most n characters from stream.
Read from underlying buffer until we have n characters or we hit EOF. If n is negative or omitted, read until EOF.
- Parameters
std (Literal['in', 'out', 'err', 'stdin', 'stdout', 'stderr']) –