install Ctrl-C handler

Diez B. Roggisch nospam-deets at web.de
Wed Feb 4 08:40:53 EST 2004


> can anybody tell me how you install something like a Ctrl-C handler in
> Python, i.e. a routine that is called when ^C is pressed and that can do
> cleanup work?

On *nix you can use the signal-module for general signal handling. There are
some caveats in multithreaded apps.

Regards,

Diez



More information about the Python-list mailing list