py2exe 실행 파일을 만들었습니다. "프로그래밍 퀴즈"입니다. 그것은 파이 게임에서 만들어지며 EXE로 실행할 때 끝까지 작동합니다. 끝에는 파이 게임 텍스트가 있기 때문에 나는 추측한다. 오류는 아래와 같습니다. 여기에 EXE로하지만 보통의 평으로 작동하지 않는 코드의 일부는 다음과 같습니다Py2Exe 파일이 끝날 때까지
def endgame():
global programmer
if programmer < 0:
programmer = 0
font = pygame.font.SysFont(None, 25)
text = font.render("You are: " + str(programmer) + "% a programmer.", True, black)
gameDisplay.blit(text, (170,200))
오류 :
C:\Python27\Programming Survey\dist>survey.exe
survey.exe:43: RuntimeWarning: use font: DLL load failed: The specified module c
ould not be found.
(ImportError: DLL load failed: The specified module could not be found.)
Traceback (most recent call last):
File "survey.py", line 223, in <module>
File "survey.py", line 217, in main
File "survey.py", line 43, in endgame
File "pygame\__init__.pyc", line 70, in __getattr__
NotImplementedError: font module not available
(ImportError: DLL load failed: The specified module could not be found.)
이와 같은 디버깅 방법 중 하나는 콘솔에서 .exe를 실행하는 것입니다. 그리고 그것이 작동하지 않고 단지 새로운 콘솔을 생성한다면, 주 코드 주위에'try :/finally :'를 사용하여 마지막에'input()'을 사용하면 어떤 것을 볼 수있는 기회를 갖게됩니다. 창문이 닫히기 전에 인쇄 중입니다. – abarnert
감사합니다. 오류가 게시되었습니다. – HKVariant
어디에서 PyGame을 얻었으며 어떻게 설치 했습니까? – abarnert