我有一些麻烦让Py2exe捆绑所有的文件到一个单一的.exe。当我不把它们捆绑在一起时,它适用于 。因此,这是setup.py
剧本时,我没有捆绑在一起我用,而且它始终工作:Py2exe捆绑文件到一个单一的exe
from distutils.core import setup
import py2exe
setup(console=['test.py'])
,所以我想所有的文件打包成一个可执行的,所以我用这个setup.py
脚本,这,并且这是不起作用的:
from distutils.core import setup
# I took this off the Internet
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "test.py"}],
zipfile = None,
)
当我运行此脚本时,将使用test.exe文件创建一个dist目录。如果我通过键入执行它 “TEST.EXE”此错误信息弹出:
See the logfile 'c:\Python26\dist\test.ext.log' for details
这是日志文件的内容:
Traceback (most recent call last):
File "test.py", line 1, in <module>
EOFError: EOF when reading a line
因此,没有人知道我可以做到这一点?我只想将Py2exe生成的 和test.py
的所有文件打包成一个可执行文件。我知道它可以做到这一点。或者还有其他方式可以做到这一点吗?
我强烈推荐[PyInstaller](http://www.pyinstaller.org/) – jterrace