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')        ##必定输出

posted @ 2019-07-28 01:59  小龙mr  阅读(349)  评论(0编辑  收藏  举报