Skip to content

thunderpoot/dontpanic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages