try:
code
except (Error1,Errror2) as e: #抓住目标错误
print("error error error" , e)
except Exception as e: #抓住所有错误
print("未知错误" , e)
else:
print("一切正常")
finally:
print("不管有错没错,都执行")
标签:Error1,错误,处理,except,抓住,error,print,异常
来源: https://www.cnblogs.com/shijieziben/p/13905475.html