python打包exe文件命令集合

# Python程序打包命令示例
# 使用PyInstaller进行打包


# 安装PyInstaller
# pip install pyinstaller


# 基础打包命令
# pyinstaller your_script.py


# 打包为单个可执行文件
# pyinstaller --onefile your_script.py


# 打包为单个可执行文件并隐藏控制台窗口(适用于GUI程序)
# pyinstaller --onefile --windowed your_script.py


# 指定输出文件名
# pyinstaller --onefile --name MyApp your_script.py


# 添加图标
# pyinstaller --onefile --icon=app.ico your_script.py


# 添加数据文件
# pyinstaller --onefile --add-data="data;data" your_script.py


# 排除不需要的模块
# pyinstaller --onefile --exclude-module matplotlib your_script.py


# 清理旧的打包文件
# pyinstaller --clean your_script.py


# 使用spec文件进行更复杂的配置
# pyinstaller your_script.spec


白俊遥博客
请先登录后发表评论
  • 最新评论
  • 总共0条评论