#!/bin/bash source venv/bin/activate # 安装打包工具 PyInstaller # pip install pyinstaller # 清理旧的构建文件 rm -rf build dist fan.spec # 将 fan.py 打包为单文件可执行程序 pyinstaller --onefile fan.py echo "打包完成!可执行文件位于 dist/fan"