I want to pause a python script when Crtl+C is pressed but to handle the rest of exceptions with different code.
If I got:
except KeyboardInterrupt:
print '\nPausing... (Hit ENTER to continue, type quit to exit.)'
try:
response = raw_input()
if response == 'quit':
break
print 'Resuming...'
except KeyboardInterrupt:
print 'Resuming...'
continue
except Exception, e:
print traceback.print_exc()
continue
sleep(170)
Won't second except go also for KeyboardInterrupt, isn't a keyboard interrupt supposed to be an exception?