python windows 下打包成exe文件

首先要下载使用的插件:pyinstaller
pip install pyinstaller
  然后运行打包命令:
pyinstaller main.py -p other.py -p other1.py —hidden-import other.py —hidden-import other1.py
  比如我的目录结构是这样:
使用Electron + vue3+python 打包(二) - 图1

  我实际上用到的文件只有:main.py(入口)、sendRequest.py
  要将这两个文件打包,我的命令是:
pyinstaller main.py -p sendRequest.py —hidden-import sendRequest.py
  最终文件则在 dist 文件中