Files
desktop-transfer/.trae/skills/pyinstaller-one/clean.py
xiaji 8a5450eeae 添加PyInstaller打包配置及清理脚本
添加translate.ico图标文件
更新.gitignore忽略.spec文件
修改main.py导入路径为main_window_final
优化translator.py的错误处理
添加pyinstaller-one技能目录及文档
更新main.spec配置排除不必要的依赖
添加verify_features.py功能验证脚本
2026-01-16 16:37:07 +08:00

17 lines
529 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import os
import shutil
import glob
import subprocess
# 2. 清理打包残留文件 等价rd /s /q build + del /f *.spec
print("开始清理打包残留文件...")
# 删除build文件夹
if os.path.exists("build") and os.path.isdir("build"):
shutil.rmtree("build")
# 删除所有.spec文件
spec_files = glob.glob("*.spec")
for spec_file in spec_files:
if os.path.exists(spec_file):
os.remove(spec_file)
print("✅ 打包完成 + 残留文件清理完毕exe文件已生成在当前目录")