Skip to main content

A popen wrapper.

Project description


# processy

### Description

*Processy* is a wrapper around `Popen` similar to the now built-in `subprocess.run()` function, which was added in Python3.5. Prior to 3.5 there was no simple sane function to run subprocesses. This is why I made *processy*. The current implementation of `subprocess.run()` still won't let you print and return stdout at the same time. *Processy* remains useful for that.

### `processy.run()`
```python
def run(
cmd: Union[list, str],
verbose: bool = True,
return_stdout: bool = False,
raise_err: bool = False,
**popen_kwargs
) -> CompletedProcess:
"""
@cmd: The Popen command. If it's a string shlex is used to split it.
@return_stdout: Returns the output from stdout.
@verbose: Print the output to stdout if True. If False call runs quite.
@raise_error: If subprocess return code is not 0.
"""
# ...
```

### `CompletedProcess`

Since Python3.5 *processy* uses the return object `CompletedProcess` that was added to the subprocess module. It's almost identical to processy's old `ProcResult` object.'

```python
CompletedProcess(
args: Union[str, list]
returncode: int
stdout: Optiona[Union[str, bytes]]
stderr: Optiona[Union[str, bytes]]
)
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

processy-1.0.7-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file processy-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for processy-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ec43b64c60300d809b6d37183669025429efeb994c59dbc351afa3236d3b47c3
MD5 916d950499b7108cc2fd36c8ccdd34eb
BLAKE2b-256 8ecb29333712d236620ae555abce170cabe65012d902ad7df42b719e43081d6b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page