python Try-Except

1523 단어 Pythontech
https://docs.python.org/ja/3/library/exceptions.html

기본적


try:
    # Do something
except:
    # Do something

특정 예외 스냅


try:
    # Do something
except [Exception/Error]:
    # Do something

여러 예외 캡처


try:
    # Do something
except (exception1, exception2):
    # Do something

좋은 웹페이지 즐겨찾기