Keyboard interrupts in Windows Python

Andrew Gregory andrew.gregory at npl.co.uk
Fri Apr 19 11:21:59 EDT 2002


I am using Python to control experiments from the interactive Window
of Pythonwin (via some simple library routines in C to write data to
interface chips). Sometimes I wish to interrupt an experiment before
it has finished, ideally by using Control C to raise an exception. But
Control C has no effect.
How can I overcome this problem? Is there another control key which I
should be using?

It would be equally acceptable to raise an exception by clicking on a
button - but I am hoping to avoid Windows programming and work
interactively for the moment.

To give an example, if I typed time.sleep(1000) how would I terminate
this command under Windows?

Andrew Gregory, National Physical Lab., UK.



More information about the Python-list mailing list