A library to capture sys.stdout and -err
Project description
StdGet
StdGet is a small python 2 and 3 compatible library that doesn't require any modules to work.
What does it do?
StdGet's purpose is to be a way to capture the StdOut (Standard Output) and StdErr (Standard Error Output).
Sounds great! How does it work and how do I use it?
How to use it:
First, let's import StdGet:
import stdgetThen, let's say we want to capture the StdOut:stdget.startstdoutcapture()And you're done! "But how do I get the information it captures?"stdget.stdouthookwill give you a list. You can just dostdget.stdouthook=[]to empty it.How it works:
What it does is it adds a layer on top of the original 'sys.stdout.write' that actually 'takes' the data and copies it into the 'stdget.stdouthook' list. It works outside of the module's layer because the sys.stdout / -in and -err are global all across the session. That's also why you can just do
import stdgetand you don't have to dofrom stdget import *(it doesn't matter).
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
File details
Details for the file stdget-1.1.2.tar.gz.
File metadata
- Download URL: stdget-1.1.2.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed6bedf1adada9a48a3d24339b79a1891ddf8d7c42259b098e2471d09cbedbff
|
|
| MD5 |
01510cb351b05865a4a84754b67b57b7
|
|
| BLAKE2b-256 |
afcd7182fd5d77b564c2b07792b904c485ee8e0dd519e94efdf5901c4a1e3fa3
|