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
pip install aerial
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.5.tar.gz
(20.1 kB
view hashes)
Built Distribution
Close
Hashes for aerial-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9126cdf4d59a5d32f81b43494540714a9fa1d507d8fae121437a5d8609613b7 |
|
MD5 | c0bab111dd0edcbfa9e2ba2fcd8f270d |
|
BLAKE2b-256 | f1af2f6c76b7219c1368632bcf6800375d9dacfdb8670cb793eb4586c97117f4 |