python windows 下打包成exe文件

  首先要下载使用的插件:pyinstaller

pip install pyinstaller

  然后运行打包命令:

pyinstaller main.py -p other.py -p other1.py --hidden-import other.py --hidden-import other1.py

  比如我的目录结构是这样:

 

  我实际上用到的文件只有:main.py(入口)、sendRequest.py

  要将这两个文件打包,我的命令是:

pyinstaller main.py -p sendRequest.py --hidden-import sendRequest.py

  最终文件则在 dist 文件中

 

posted @ 2019-12-02 15:57  名字不好起啊  阅读(871)  评论(0编辑  收藏  举报