python异常处理
常用:
try:
"""执行以下语句"""
pass
except Exception as e:
"""异常时执行"""
print('错误类型是', e.__class__.__name__)
print('错误明细是', e)
raise e
else:
"""正常时执行"""
pass
finally:
"""无论异常还是正常都执行"""
pass
本文来自博客园,作者:JaxonYe,转载请注明原文链接:https://www.cnblogs.com/yechangxin/articles/16501193.html
侵权必究