python代码打包成exe 应用程序文件

有py2app/py2exe/pyinstaller三个库可以用,这里以pyinstaller库为例

1. 安装pyinstaller 

  pip install pyinstaller

2. 切换到工作目录

  cd  xxx

3. 打包命令

  pyinstaller [项目启动文件]

  pyinstaller -F  -w  app.py --add-data=templates;templates --add-data=static;static --add-data=UI;UI   # windows以;分割,linux以:分割

  pyinstaller各个参数参考https://blog.csdn.net/weixin_39000819/article/details/80942423

原文地址:https://www.cnblogs.com/pyweb/p/12614327.html