Handling system signals and taking actions on application termination
Project description
signal_handler
Handling system signals and taking actions on application termination
Example:
#!/usr/bin/python3
from signal_handler import SignalHandler
if __name__ == '__main__':
terminator = SignalHandler(handler=lambda: print(
'\nOn terminate actions here!\n'))
while True:
if not terminator.terminated:
print('Cycle')
else:
print(f"Message: {terminator.message}\n"
f"Traceback: {terminator.traceback}\n"
f"Signal name: {terminator.signal_name}")
break
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
signal_handler-0.0.5.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file signal_handler-0.0.5.tar.gz
.
File metadata
- Download URL: signal_handler-0.0.5.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebbcb5ac796588c6a0028b2b24d52176500bd95794da0bd5faed39e45d19b4ac |
|
MD5 | 40ec61bbffca98235209fe98811b8072 |
|
BLAKE2b-256 | 87ec1dd2c6bfd215f17afd77358c073996a7e17bf0fddd7fa5e03656437184a4 |
File details
Details for the file signal_handler-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: signal_handler-0.0.5-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36e6f7a1a5a1b3ac1c78f6c4334cc050b8313c1a2bbba5040fef6cd26bbd2f4a |
|
MD5 | 2a6703b00f30ae8a301d821f9639631f |
|
BLAKE2b-256 | 6533165b08fecb51726eeb2b1c8eff57ed54b9bc58afdfa3b9325a216d6f72d8 |