파이썬 클래스의 맨 위에있는 선언이 __init__
의 문장과 일치하는지 궁금합니다. 예를 들어python 클래스 내의 선언은 _init_와 동일합니까?
import sys
class bla():
print 'not init'
def __init__(self):
print 'init'
def whatever(self):
print 'whatever'
def main():
b=bla()
b.whatever()
return 0
if __name__ == '__main__':
sys.exit(main())
출력은 : (!) 참고로
not init
init
whatever
, 지금 나는 또한 얻을 :이 이유에
Fatal Python error: PyImport_GetModuleDict: no module dictionary!
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
어떤 아이디어? 미리 감사드립니다.
이 오류는 Python 설치에 문제가 있음을 나타냅니다. 그것은 또 다른 질문에 대한 주제입니다. 어떤 버전인지, 어떤 OS인지, 어떻게 가져 왔는지 등과 같은 세부 사항을 포함시켜야합니다. – delnan