【发布时间】:2012-07-26 01:26:11
【问题描述】:
我使用 python 和 wxpython 创建了一个 GUI 程序。现在可以将其转换为可执行文件。在过去的两天里,我按照 py2exe 的各种说明进行了尝试。命令提示符的所有说明均参考旧版本的 Windows,我使用的是 Windows 7。我以前从未使用过命令提示符,因为我还是编程新手。 py2exe 是创建可执行文件的最佳方式还是有更好的选择?
我已按照说明创建 setup.py 文件,内容如下:
from distutils.core import setup
import py2exe
setup(windows = ["Core.py"])
当我在命令提示符中输入命令时:
C:\Python27\Cylinderdrawer\python setup.py py2exe
我得到以下信息:
'C:\Python27\Cylinderdrawer\python' is not recognized as an internal or eternal command, operable program or batch file
【问题讨论】:
-
启动 IDLE 并运行:
import sys和print sys.executable。它打印什么? -
C:\Python27\Cylinderdrawer\python应该是C:\Python27\python。 -
好的,Kupiakos 会打印“C:\Python27\pythonw.exe”。
-
for g.d.d.c 现在似乎是这样,我想我遇到了一个新错误。它说“错误:Core.py:没有这样的文件或目录”