captures temporarily stdout and stderr
Tested against Windows 10 / Python 3.10 / Anaconda
pip install stderrstdoutcapture
GetStdErr
A context manager that captures and temporarily redirects standard error (stderr) to a list.
Usage:
from stderrstdoutcapture import GetStdErr
def errtest():
try:
x = 5 / 0
except Exception:
return "error"
with GetStdErr() as o2:
returnvalue2 = errtest()
print(o2) # Access captured stderr as a list
print(f"{returnvalue2=}") # Display the return value of the function
Methods:
__enter__(*args, **kwargs): Enter the context and redirect stderr to a StringIO buffer.
__exit__(*args, **kwargs): Exit the context and append the captured stderr to the list.
GetStdOut
A context manager that captures and temporarily redirects standard output (stdout) to a list.
Usage:
from stderrstdoutcapture import GetStdOut
def outtest():
try:
x = 5 / 5
print("five devided by five is one")
return x
except Exception:
pass
with GetStdOut() as o1:
returnvalue1 = outtest()
print(o1) # Access captured stdout as a list
print(f"{returnvalue1=}") # Display the return value of the function
Methods:
__enter__(*args, **kwargs): Enter the context and redirect stdout to a StringIO buffer.
__exit__(*args, **kwargs): Exit the context and append the captured stdout to the list.
Metadata
Release files for stderrstdoutcapture 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stderrstdoutcapture-0.10.tar.gz | 3.3 kB | Without provenance | Details for stderrstdoutcapture-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stderrstdoutcapture-0.10-py3-none-any.whl | Python 3 | none | any | Details for stderrstdoutcapture-0.10-py3-none-any.whl |
Total release size: 7.8 kB
Release files / stderrstdoutcapture-0.10.tar.gz
| Download URL | stderrstdoutcapture-0.10.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36d889a09cdddb40ca5213c0318d47fd8f5b5ab4a5c7fa4361d92e01b6839f4e
|
|
BLAKE2b-256 checksum How to use checksums |
8da557b5002187fff50bdb73321f9cfd43a7a69c10adbec0e09d3c30ebccabbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / stderrstdoutcapture-0.10-py3-none-any.whl
| Download URL | stderrstdoutcapture-0.10-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e37a6a8d4bc392f308866f20ee42fbdb494f63a0397aea7789829f8ace2962f3
|
|
BLAKE2b-256 checksum How to use checksums |
60c35e633b8a5fb6bfcac2705b2b3c22da403c0eeccb63bf944e8dec5a2d8f35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for stderrstdoutcapture 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.