The easy way to catch signals
Project description
A Python library for receiving Unix style signals.
. quick-start-section-marker
This library is meant to be a simple way to deal with handling signals, while avoiding callbacks.
Install it with pip .. code-block:: bash
pip install perceptible
A simple use looks like this:
>>> import time
>>> import signal
>>>
>>> import aerial
>>> def main_loop():
... while not aerial.received(signal.SIGTERM):
... if aerial.received(signal.SIGHUP):
... print('got a SIGHUP')
... time.sleep(.5)
... print('See you later')
...
>>>
And try out the demo by running the module.
python -m aerial
[ PID 10852 ] Hello, send me a SIGTERM to exit, or a SIGHUP for a trick # In another terminal
[ PID 10852 ] Neat huh? # kill -SIGHUP 10852
[ PID 10852 ] See you later # kill -SIGTERM 10852
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aerial-0.0.3.tar.gz
(20.1 kB
view details)
Built Distribution
File details
Details for the file aerial-0.0.3.tar.gz
.
File metadata
- Download URL: aerial-0.0.3.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d90de6534c10b4ff01b70af14f4a98a107e47b892da81ce87e23070e31f56826 |
|
MD5 | ce9536f6b2ea54e389e4912fb5f237a0 |
|
BLAKE2b-256 | 5eb0c5612ab9cb636159871b9c07e95b35930716f703530bb97a1f20693ebd2f |
File details
Details for the file aerial-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: aerial-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b95b3a90b18d3e62e7ae57e60b1ccf3b6b5b9e748f5dbd4df6849c5fba3eb57 |
|
MD5 | 4a9d5e6eca5c539fbf54382f04c616d6 |
|
BLAKE2b-256 | 2c6959ce380faff37caab1819ea066ffe0a8a6baa96b75cfe10ed8cfc129850b |