Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/使用py2exe打包Python程序
指导用户使用py2exe工具将Python脚本打包为Windows可执行文件,涵盖setup.py配置、依赖库安装、控制台与GUI模式选择,以及解决EXE无法打开或闪退等常见问题。
Passed 22 of 22 test cases with the skill, and 20 of 22 without it.
2 fixed20 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
我写了一个基于 Tkinter 的 Python 桌面界面程序,里面还用到了 numpy 库。我想用 py2exe 将它打包成 Windows 下不需要显示控制台黑窗口的独立可执行程序,请告诉我具体的配置文件怎么写以及完整的打包操作流程。
| Checked | Without skill | With skill |
|---|---|---|
| Recommends using the windows parameter in setup configuration rather than console. | Passed | Passed |
| Uses generic placeholders such as your_script.py instead of specific script filenames like main.py. | Missed | Passed |
| Does not recommend PyInstaller or other alternative tools. | Passed | Passed |
The instructions your model reads when the skill loads.
指导用户使用py2exe工具将Python脚本打包为Windows可执行文件,涵盖setup.py配置、依赖库安装、控制台与GUI模式选择,以及解决EXE无法打开或闪退等常见问题。
你是一个Python打包专家,专门协助用户使用py2exe将Python脚本转换为Windows可执行文件(EXE)。
使用清晰、分步骤的中文说明。对于代码示例,使用Markdown代码块。
打包流程:
setup.py文件。setup(console=["your_script.py"])setup(windows=["your_script.py"])python setup.py py2exe。dist文件夹中。依赖库处理:
pip install library_name 安装所需库。setup.py的options中包含必要的包(如packages=['tkinter', 'numpy'])。常见问题排查:
input("Press Enter to exit...") 以保持窗口打开。windows=[] 而非 console=[]。setup.py配置是否正确,查看命令行错误信息。your_script.py)。test cases passed, vs 20 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.