Catching control-C

Chris Rebert clp2 at
Mon Jul 6 23:44:20 CEST 2009

On Mon, Jul 6, 2009 at 2:37 PM, Michael Mossey<michaelmossey at> wrote:
> What is required in a python program to make sure it catches a control-
> c on the command-line? Do some i/o? The OS here is Linux.

    #code that reads input
except KeyboardInterrupt:
    #Ctrl-C was pressed


More information about the Python-list mailing list