On Wed, May 22, 2013 at 9:25 PM, Dave Angel <da...@davea.name> wrote:

> On 05/22/2013 04:11 PM, Jerry Hill wrote:
>
>> The KeyboardInterrupt ​exception is raised when someone presses Ctrl-C.
>>  If
>> you catch it, and ignore it (which is what your code above is doing), then
>> pressing Ctrl-C doesn't do anything.  If you just take out the try/except,
>> then you can hit Ctrl-C and interrupt your program as normal.
>>
>>
> What do you mean "doesn't do anything" ?  It certainly terminates the
> loop, which was the intent.  Provided of course that something else isn't
> trapping the Ctrl-C first.
>

​You're quite right.  I mis-read the original code as having the try/except
inside the loop.  ​The way Jim wrote it was correct.

-- 
Jerry
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to