Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to kill a script if error is hit python

import sys

try:
  print("stuff")
except:
  sys.exit(1) # exiing with a non zero value is better for returning from an error
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #kill #script #error #hit #python
ADD COMMENT
Topic
Name
8+2 =