python 错误捕捉

错误继承表:https://docs.python.org/zh-cn/3/library/exceptions.html#exception-hierarchy

菜鸟教程:https://www.runoob.com/python/python-exceptions.html

def 函数():

      try:  

             内容        ###正确输出

      except 错误表  in e:

              输出内容 ###错误输出

       finally:  

               输出内容   ##必定输出

print('END')        ##必定输出

猜你喜欢

转载自www.cnblogs.com/wjbk/p/11257540.html