Capture the stdout or stderr output as a list in a context manager block (with).
Project description
stdout_stderr_capturing
Capture the stdout or stderr output as a list in a context manager block (with).
Maybe better alternatives:
Capture stdout:
with Capturing() as output:
print('line 1')
print(output[0])
is equivalent to
with Capturing(stream='stdout') as output:
print('line 1')
Capture stderr:
with Capturing(stream='stderr') as output:
print('line 1', file=sys.stderr)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for stdout_stderr_capturing-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd220cb95464b6270c78b9e6126cd2c7eba2eb0e3874df43a27e32513be67f5d |
|
MD5 | e662b74f871def6fc2036b03732458f5 |
|
BLAKE2b-256 | 11433667093c708d765ec818213f01fdb0bb01934295a904678e093a190e127e |
Close
Hashes for stdout_stderr_capturing-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c01ce47f1328de157dd197a70331011ee93b4a57330211100f013e67c4f82240 |
|
MD5 | fda4e88288c51fe973efac3377e7e77f |
|
BLAKE2b-256 | 419c035ac9e6cfcbc7197c92ee8402f60e830b42488661828e946608b3e6bb6b |