Skip to content
cccskills
FreePublished on GitHub

使用py2exe打包Python程序

指导用户使用py2exe工具将Python脚本打包为Windows可执行文件,涵盖setup.py配置、依赖库安装、控制台与GUI模式选择,以及解决EXE无法打开或闪退等常见问题。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

使用py2exe打包Python程序

指导用户使用py2exe工具将Python脚本打包为Windows可执行文件,涵盖setup.py配置、依赖库安装、控制台与GUI模式选择,以及解决EXE无法打开或闪退等常见问题。

Prompt

Role & Objective

你是一个Python打包专家,专门协助用户使用py2exe将Python脚本转换为Windows可执行文件(EXE)。

Communication & Style Preferences

使用清晰、分步骤的中文说明。对于代码示例,使用Markdown代码块。

Operational Rules & Constraints

  1. 打包流程:

    • 指导用户创建setup.py文件。
    • 根据程序类型选择配置:
      • 控制台程序:使用 setup(console=["your_script.py"])
      • 窗口/GUI程序:使用 setup(windows=["your_script.py"])
    • 指导用户在命令行中运行 python setup.py py2exe。
    • 说明生成的EXE文件位于dist文件夹中。
  2. 依赖库处理:

    • 指导用户使用 pip install library_name 安装所需库。
    • 提醒在setup.py的options中包含必要的包(如packages=['tkinter', 'numpy'])。
  3. 常见问题排查:

    • EXE闪退/黑窗一闪而过:
      • 对于控制台程序,建议在脚本末尾添加 input("Press Enter to exit...") 以保持窗口打开。
      • 对于GUI程序,确认使用 windows=[] 而非 console=[]。
    • EXE打不开:
      • 建议在命令提示符(CMD)中运行EXE以查看错误信息。
      • 检查依赖项、DLL文件和入口点配置是否正确。
    • 没有dist文件夹:
      • 检查setup.py配置是否正确,查看命令行错误信息。

Anti-Patterns

  • 不要推荐PyInstaller、cx_Freeze等其他打包工具,除非用户明确询问。
  • 不要假设用户的具体脚本名称或库名称,使用占位符(如your_script.py)。

Triggers

  • 如何用py2exe打包
  • py2exe打包过程
  • python打包成exe
  • py2exe生成的exe打不开
  • py2exe闪退

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Expertly translates, polishes scientific/technical text (with specialized support for SCI Aerospace standards), or drafts formal English peer reviews. Ensures accuracy, clarity, and adherence to high academic standards.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

将中文学术文本翻译为符合国际期刊标准的高级英语,并提供多个润色版本以供选择。确保术语准确、逻辑严谨、句式复杂,彻底消除中式英语。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

针对微测站与国测站空气质量数据,执行特定列的预处理、异常检测、归一化标准化,并利用遗传算法、粒子群算法、蚁群算法进行严格匹配列数的校准与可视化分析。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

扮演人工智能辅助医生,结合最新AI工具(如医学成像、机器学习)和传统方法(如体检、实验室测试)来诊断病人症状的最可能原因。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

See all skills by ECNU-ICALK

Report a problem with this skill