我正在尝试使用cx_Freeze编译我的Python脚本,这是我的设置文件:
import cx_Freeze
import sys
import matplotlib
import os
base = None
if sys.platform == 'win32':
base = "Win32GUI"
os.environ['TCL_LIBRARY'] = r'C:\\Python35\\tcl\\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\\Python35\\tcl\\tk8.6'
executables = [cx_Freeze.Executable("HomeScreen.py", base=base,
icon="icon.png")]
cx_Freeze.setup(
name = "LeagueBoost",
options = {"build_exe":{"packages": ["sqlite3","requests","time","sys","os","statistics","matplotlib","random","collections"],
"include_files": ["Assets", "LeagueBoost_v1.py","LBRun.py","graphSetup.py","profilepage.py","Assets_rc.py"]}},
version = "1",
executables = executables
)
但是,当我输入cmd命令C:/python35/python.exe
时,它会到达copying C:\python35\python35.dll -> build\exe.win-amd64-3.5\python35.dll
并弹出“Python已停止工作”。
ico
文件作为应用程序图标,而不是 cx_Freeze。在维基百科的 ICO (file format) 页面上,可以看到:在 Windows 中,所有向用户显示图标的可执行文件,无论是在桌面、开始菜单还是在 Windows 资源管理器中,都必须使用 ICO 格式携带图标。
然而,我没有在“官方”的 Windows 文档中找到相应的声明。 - jpeg