51docs/it/python/python-exception.org at master · wuyao721/51docs · GitHub
Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 890 Bytes

python-exception.org

File metadata and controls

38 lines (32 loc) · 890 Bytes

python异常一锅端

python异常一锅端:

try:
    try_suite
except Exception1:
    suite_for_Exception1
except (Exception2, Exception3, Exception4):
    suite_for_Exceptions_2_3_and_4
except Exception5, Argument5:
    suite_for_Exception5_plus_argument
except (Exception6, Exception7), Argument67:
    suite_for_Exceptions6_and_7_plus_argument
except:
    suite_for_all_other_exceptions
else:
    no_exceptions_detected_suite
finally:
    always_execute_suite

参考资料: python核心编程第十章

转载请注明出处:http://www.wuyao721.com/python-exception.html