⛏ Subprocesseses for subhumanses ⛏
Project description
⛏️sproc: subprocesseses for subhumanses ⛏
Run a command in a subprocess and yield lines of text from stdout and
stderr independently.
Useful for handling long-running proceesses that write to both stdout and
stderr.
Simple Example
import sproc
CMD = 'my-unix-command "My Cool File.txt" No-file.txt'
for ok, line in sproc.Sub(CMD) as sp:
if ok:
print(' ', line)
else:
print('!', line)
if sp.returncode:
print('Error code', sp.returncode)
# Return two lists of text lines and a returncode
out_lines, err_lines, returncode = sproc.run(CMD)
# Call callback functions with lines of text read from stdout and stderr
returncode = sproc.call(CMD, save_results, print_errors)
# Log stdout and stderr, with prefixes
returncode = sproc.log(CMD)
API Documentation
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
sproc-2.5.0.tar.gz
(3.6 kB
view details)
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
sproc-2.5.0-py3-none-any.whl
(4.4 kB
view details)
File details
Details for the file sproc-2.5.0.tar.gz.
File metadata
- Download URL: sproc-2.5.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3318224748028bbef39da2ccb414870252124d5602686d23c0a33b99b4b0fd88
|
|
| MD5 |
477d0e11f17557e5123e5aa2adcf6cf4
|
|
| BLAKE2b-256 |
6238970266ceafe9b9c2fdb0ed5f288b26b70411ee306871234d11578433a699
|
File details
Details for the file sproc-2.5.0-py3-none-any.whl.
File metadata
- Download URL: sproc-2.5.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e3186cb8e07c1a56d392933aa619033ebfb6f2b155e0a5747ad69f5197a6522
|
|
| MD5 |
1c4729f7d3b49362de22f609de421833
|
|
| BLAKE2b-256 |
53905d2ae814acc988fbe0edcd1bb8cf1b0529ecfeabaa68a09ea1961fc708cf
|