<div dir="ltr">On Wed, May 22, 2013 at 9:25 PM, Dave Angel <span dir="ltr"><<a href="mailto:davea@davea.name" target="_blank">davea@davea.name</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 05/22/2013 04:11 PM, Jerry Hill wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The KeyboardInterrupt exception is raised when someone presses Ctrl-C. If<br>
you catch it, and ignore it (which is what your code above is doing), then<br>
pressing Ctrl-C doesn't do anything. If you just take out the try/except,<br>
then you can hit Ctrl-C and interrupt your program as normal.<br>
<br>
</blockquote>
<br></div></div>
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.<span class="HOEnZb"><font color="#888888"></font></span><br>
</blockquote></div><br><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">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. <br>
<br>-- <br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Jerry<br></div><br></div></div>