Answers for "how to kill a script if error is hit python"

0

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
Posted by: Guest on October-04-2021

Code answers related to "how to kill a script if error is hit python"

Python Answers by Framework

Browse Popular Code Answers by Language