Skip to main content

Handles keyboard interrupt silently and gracefully

Project description

shhhinterrupt

Gracefully and shhh... (silently) handles keyboard interrupts.

You can either pass a string to print, e.g. @handle_interrupt("Please come again.") or you can use the decorator without parentheses to use the default message @handle_interrupt.

Full example:

from shhhinterrupt import handle_interrupt
import time

@handle_interrupt("He walked away.")
def main():
    print("What's your name?")
    time.sleep(5)
    print("Tony!")

if __name__ == "main":
    main()

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

shhhinterrupt-0.1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shhhinterrupt-0.1.0-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file shhhinterrupt-0.1.0.tar.gz.

File metadata

  • Download URL: shhhinterrupt-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for shhhinterrupt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8ad07d91c7a5a2cfec4ebb7273bc7902828f9aa85f7728658042b30cec55f0c2
MD5 cf3675a0bad5e34784a3861395fc9e81
BLAKE2b-256 29d09b19a54acb004d188273fed51adfeba2e78516ef7a1c17442f690e2b2930

See more details on using hashes here.

Provenance

The following attestation bundles were made for shhhinterrupt-0.1.0.tar.gz:

Publisher: test_build_publish.yml on RobertDusk/py-shhhinterrupt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shhhinterrupt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shhhinterrupt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for shhhinterrupt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 461a8f57caab5d7f1f06e7c0b257c65c9c2285387908ff15da2c2688090a6853
MD5 1fc049ad10b84beb846f4bccf67dbb35
BLAKE2b-256 bb7a2328c1eb392c8334e7dd3ce4a9c7532579d27202f98d96e36b73a9c3d2dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for shhhinterrupt-0.1.0-py3-none-any.whl:

Publisher: test_build_publish.yml on RobertDusk/py-shhhinterrupt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page