아래의 python에서 단일 노드 컴퓨터 **에서 RSU 메시지가 지원되지 않습니다 **는 인쇄되지 않습니다. 누구든지 도와 드릴까요 ??파이썬 예외 처리
#! /usr/bin/env python
import sys
class SWMException(Exception):
def __init__(self, arg):
print "inside exception"
Exception.__init__(self, arg)
class RSUNotSupported(SWMException):
def __init__(self):
SWMException.__init__(self, "**RSU is not supported on single node machine**")
def isPrepActionNeeded():
if 1==1:
raise RSUNotSupported()
try:
isPrepActionNeeded()
except:
sys.exit(1)
예외 .__ init __ (self, arg) 이 init 호출에서 arg 인수는 무엇입니까 ?? 그것은 메시지를 인쇄하지 않습니다. – mandeep
메시지를 예외의 일부로 만드는 것이므로 원하는 경우 나중에 직접 인쇄 할 수 있습니다. – agf
좋습니다. 예. 고마워. 정말 도움이되었다. – mandeep