for a in range(big_num):
try:
pass # Do your thing
except KeyboardInterrupt:
print("You pressed ctrl c...")
break
except Exception as e: # Any other exception
print(str(e)) # Displays the exception without raising it
break
try:
for a in range(big_num):
pass # Do your thing
except KeyboardInterrupt:
print("You pressed ctrl c...")
except Exception as e:
print(str(e))