Cómo matar un script si el error es presionado python

import sys

try:
  print("stuff")
except:
  sys.exit(1) # exiing with a non zero value is better for returning from an error
Shy Seal