【发布时间】:2014-03-31 15:19:27
【问题描述】:
我正在开发我的第一个 Python 项目,我需要使用 py2exe 进行编译。我写了这个 setup.py 代码:
from distutils.core import setup
import py2exe
import sys
import os
if len(sys.argv) == 1:
sys.argv.append("py2exe")
setup( options = {"py2exe": {"compressed": 1, "optimize": 2,"dll_excludes": "w9xpopen.exe",'dist_dir': "myproject", "ascii": 0, "bundle_files": 1}},
zipfile = None,
console = [
{
"script": "myapplication.py", ### Main Python script
"icon_resources": [(0, "favicon.ico")] ### Icon to embed into the PE file.
}
],)
os.system('upx -9 dist/*.exe')
os.system("rmdir /s /q build")
os.system("del /q *.pyc")
安装代码正在运行,但我需要将已编译应用程序的名称从 myapplication 更改为 project.exe。 py2exe 的哪些选项可以更改输出应用程序的名称?
【问题讨论】:
-
将
name参数设置为设置函数setup(name="project", ...的参数