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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stdout_stderr_capturing-0.2.1.tar.gz.
File metadata
- Download URL: stdout_stderr_capturing-0.2.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1019-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd220cb95464b6270c78b9e6126cd2c7eba2eb0e3874df43a27e32513be67f5d
|
|
| MD5 |
e662b74f871def6fc2036b03732458f5
|
|
| BLAKE2b-256 |
11433667093c708d765ec818213f01fdb0bb01934295a904678e093a190e127e
|
File details
Details for the file stdout_stderr_capturing-0.2.1-py3-none-any.whl.
File metadata
- Download URL: stdout_stderr_capturing-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1019-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c01ce47f1328de157dd197a70331011ee93b4a57330211100f013e67c4f82240
|
|
| MD5 |
fda4e88288c51fe973efac3377e7e77f
|
|
| BLAKE2b-256 |
419c035ac9e6cfcbc7197c92ee8402f60e830b42488661828e946608b3e6bb6b
|