https://github.com/jonghwanhyeon/python-process
A Python package that provides a simple and intuitive interface for spawning, managing, and interacting with processes
https://github.com/jonghwanhyeon/python-process
Last synced: 2 months ago
JSON representation
A Python package that provides a simple and intuitive interface for spawning, managing, and interacting with processes
- Host: GitHub
- URL: https://github.com/jonghwanhyeon/python-process
- Owner: jonghwanhyeon
- License: mit
- Created: 2024-08-05T10:42:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-20T16:05:33.000Z (over 1 year ago)
- Last Synced: 2024-09-21T10:08:28.410Z (about 1 year ago)
- Language: Python
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-process

A Python package that provides a simple and intuitive interface for spawning, managing, and interacting with processes.
## Help
See [documentation](https://python-process.readthedocs.io) for more details
## Install
To install **python-process**, simply use pip:
```console
$ pip install python-process
```
## Usage
You can find more examples in [the documentation](https://python-process.readthedocs.io/en/stable/examples/running-command/).
### Synchronous API
```python
from process import Process
def main() -> None:
with Process("echo 'Hello World!'") as process:
print(process.output()) # b'Hello World!\n'
if __name__ == "__main__":
main()
```
### Asynchronous API
```python
import asyncio
from process.asyncio import Process
async def main() -> None:
async with Process("echo 'Hello World!'") as process:
print(await process.output()) # b'Hello World!\n'
if __name__ == "__main__":
asyncio.run(main())
```