python.exe在哪个文件_pythonexe文件中的images文件夹放在哪里?

我已经把我设计的python游戏转换成了一个exe。运行exe本身会导致它闪烁然后关闭,这意味着发生了错误。从命令提示符运行它也会导致错误,但会记录它:Cannot load image: Playfield.png

Couldn't open images\Playfield.png

这说明load_image块失败了。我以前没有images目录时遇到过这种情况。在

我试图将images文件夹移到dist目录。这是显示的错误:

^{pr2}$

这是我第一次使用py2exe,所以我不太确定发生了什么。原始python文件本身,表_战争.py,按预期运行。在

如果有帮助的话,整个Table_Wars文件夹的位置在我的桌面上的一个名为Games的文件夹中(C:\Users\Oventoaster\Desktop\Games\Table_Wars)。我运行的是Windows7 32位操作系统。在

如有要求,这是输出.txt我产生了:Folder PATH listing for volume OS

Volume serial number is 7659-4C9C

C:\USERS\OVENTOASTER\DESKTOP\GAMES\TABLE_WARS

build

bdist.win32

winexe

bundle-2.7

collect-2.7

ctypes

distutils

email

mime

encodings

logging

multiprocessing

dummy

pygame

threads

unittest

xml

parsers

temp

dist

images

这是设置.py我曾经转换文件:from distutils.core import setup

import py2exe

setup(console=['Table_Wars.py'])

编辑:我尝试使用完整的py2exe示例。这将创建exe,但给出相同的Cannot load image错误。试图将images文件夹与exe放在同一个文件夹中会创建一个Runtime Error: The application requested the runtime to terminate it in an unusual way.

Slace Diamond建议的代码缩写形式阻止了py2exe找到Table_Wars.py:

从命令:running py2exe

*** searching for required modules ***

error: Table_Wars.py: No such file or directory.

setup和{}在同一目录中。如果有帮助,我输入完整的路径python.exe以及设置.py. 在

编辑:我好像越来越近了。我把images目录放在self.extra_datas中,现在我得到了:

Fatal Python error: (segmentation fault)This application has requested the runtime to terminate it in an unusual way. Please contact the application's suppourt team for more information

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值