📜  如果遇到错误,如何杀死脚本 python 代码示例

📅  最后修改于: 2022-03-11 14:46:49.343000             🧑  作者: Mango

代码示例1
import sys

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