질문 : Python에서 예외를 인쇄하는 방법은 무엇입니까? try: something here except: print('the whatever error occurred.') except: 블록에서 오류 / 예외를 어떻게 인쇄 할 수 있습니까? 답변 Python 2.6 이상 및 Python 3.x의 경우 : except Exception as e: print(e) Python 2.5 이하의 경우 다음을 사용합니다. except Exception,e: print str(e) 출처 : https://stackoverflow.com/questions/1483429/how-to-print-an-exception-in-python