セットアップ ファイルに次のコードを記述し、sdl_ttf.dll"、"SDL.dll の両方を既定のフォルダーに含めます。ただし、次のエラー メッセージが表示されます。
NotImplementedError:font module not available
<Import error: DLL load failed:can't find assigned module>
コード
from distutils.core import setup
import py2exe,sys,os
import pygame
setup(console=['blackjack.py'])
origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
if os.path.basename(pathname).lower() in ["sdl_ttf.dll", "SDL.dll"]:
return 0
return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL
pygamedir = os.path.split(pygame.base.__file__)[0]
os.path.join(pygamedir, pygame.font.get_default_font()),
os.path.join(pygamedir, 'SDL.dll'),
os.path.join(pygamedir, 'SDL_ttf.dll')
何か問題がありますか?