Why code like that is not catching CTRL-C?
MaxVal = 10000
StepInterval = 10
for i in range(1,MaxVal,StepInterval):
try:
print str(i)
except KeyboardInterrupt:
break
print "done"
My expectation is -- if CTRL-C is pressed while program is running, KeyboardInterrupt is supposed to leave the loop. It does not.
Any help on what I'm doing wrong?