Skip to main content

listen

Simple but powerful signal handling to process OS signals in python

##Example Usage:

import listen
import subprocess

Instanciate SignalHandler

sig_hand = listen.SignalHandler()

Start external process

external_process = subprocess.Popen(['sh', '-c', 'sleep 30'])

Register some signal handlers to kill external process on SIGINT (ctrl-c)

kill_event = sig_hand.reg_on_status(external_process.kill)

Wait for external process

external_process.wait()

Press ctrl-c to send SIGINT or alternatively use the following to unregister the event

sig_hand.del_status_event(kill_event)

For a more detailed example including interaction with bash please see the tests/example.py and tests/external_process.bash

Release files for listen 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for listen 0.2.1
File Size Uploaded
listen-0.2.1.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for listen 0.2.1
File Interpreter ABI Platform
listen-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / listen-0.2.1.tar.gz

Download URL listen-0.2.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5d28703b342fb8847de64cac473abba91b17fc4430f1c976ba381bb9bedfe2ee
BLAKE2b-256 checksum
How to use checksums
3c5c1218bff42d76a8c7233f6282ff1e84282175a3adc0649aa504ee9a89b1ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

Release files / listen-0.2.1-py3-none-any.whl

Download URL listen-0.2.1-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87eecc0aff33ff54d5542cd8972dbaf21baeb9c06d3ddbb2a2c7290c85e3e69e
BLAKE2b-256 checksum
How to use checksums
51f73dc4278887bc260ce17943a9cc0ffd2694d58f402c686baee40eac094f50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.7

1 release file

0.1.6

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page