【Python】【异常】

https://www.jianshu.com/p/2868b3193533

 

直接抛出异常 中断程序

 

捕获

    try:
        。。。
    except Exception as e:
        print(e.args[0].reason.args[0])

 

posted @ 2020-08-22 11:46  淡怀  阅读(116)  评论(0编辑  收藏  举报