用try except语句捕获异常
try:
需要执行的代码
except Exception as e:
print('错误类型是',e.__class__.__name__)
print('错误明细是',e)
用try except语句捕获异常
try:
需要执行的代码
except Exception as e:
print('错误类型是',e.__class__.__name__)
print('错误明细是',e)