Skip to main content

Suppress Ctrl+C traceback spam.

Project description

🚀 dontpanic

A very simple Python module to suppress KeyboardInterrupt traceback spam when pressing ^C.

Why?

By default, Python screams at you when you press ^C to interrupt a script. (Proper languages like Perl don't do this.)

This module catches KeyboardInterrupt signals and handles them gracefully.

Installation

pip install dontpanic

Usage

import dontpanic

print('Press control-C to interrupt this program')
while True:
    pass  # Press ^C to interrupt

... or with a custom message:

import dontpanic

dontpanic.set_message("Exiting...")

print('Press control-C to interrupt this program')
while True:
    pass  # Press ^C to interrupt

Don't Panic

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

dontpanic-0.1.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

dontpanic-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dontpanic-0.1.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dontpanic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ea540230b5b951f71c772b770cdf97470752b8346e2ce1bba93bbb06fd02345d
MD5 c60cc32c3fcf2f86ec8e24552efd0168
BLAKE2b-256 5ba86edc6fe86e5e67c481339129a2897ed7bbf2bd7e10c4d7fed475fcfb0c34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dontpanic-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dontpanic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01f58ee1ab31c0ae8b882b12345361ae99865ea6f561c9cf3cfd54f9cbaf22b8
MD5 e6afd2daf13b5b3f0fc6c89d326b4d66
BLAKE2b-256 ae6f20941809425d5e573cf7c27c50718e395183f92896729689a977c9f46618

See more details on using hashes here.

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