私はPygameで2048年にプロジェクトをやっています。デフォルトpythonインタプリタpyinstaller(pygame)
プログラムはダブルクリックすると、またコマンドプロンプトからも正常に動作します。 < - この使用しているC:
class newSprite(pygame.sprite.Sprite):
def __init__(self,filename):
if filename != "0.png":
pygame.sprite.Sprite.__init__(self)
self.images=[]
self.images.append(loadImage(filename))
print(self.images[0])
self.image = pygame.Surface.copy(self.images[0])
self.currentImage = 0
self.rect=self.image.get_rect()
self.rect.topleft=(0,0)
self.mask = pygame.mask.from_surface(self.image)
self.angle = 0
がやって:
私はexeファイルにそれを変更しようとするpyInstallerのを使用する場合、\ Python27 \のpython.exeしかしは、次のコードはエラーになります私はCを使用してスクリプトを実行すると
gameboard = newSprite("game board.png")
は
TypeError:descriptor "copy" requires a pygame.surface object but received a "Nonetype".
の原因:\ WINDOWS \ py.exeを、私は同じエラーを取得します。
私は、Pyinstallerがそのインタープリタとしてc:\ Python27 \ python.exeではなくc:\ Windows \ py.exeを使用していると思われます。どうすればこの問題を解決できますか?
更新! :問題はpyinstallerがイメージファイルを正しくバンドルしていないように見えますが、スペックファイルの変更にもかかわらず追加できません。 – chuahziyang