1.简单打包

# -D,--onedir创建包含可执行文件的单文件夹包(默认)
pyinstaller *.py


2.打包为单个*.exe文件

# -F, - onefile创建一个文件捆绑的可执行文件。
pyinstaller -F *.py


3.使打包后的EXE文件不带小黑框

# -c 打开标准i/o控制台窗口(默认)
# -w 无标准i/o控制台窗口
pyinstaller -w *.py


4.多个*.py文件同时打包

pyinstaller main.py -p other-1.py -p other-2.py


5.添加资源文件

1)把所有的文件都放在一个文件夹里面。

2)执行:

pyinstaller --clean -F callMain.py --add-binary=D:\WinPyQt5.9-32bit-3.5.3.1\PyQt5-codes\pack\yundamaAPI.dll;''

6.添加图标

pyinstaller *.py -i **.ico


7.其他参数在使用之后添加,或者各位在评论区添加,有时间我会给补充上来。

相关文章:

  • 2021-06-05
  • 2021-11-10
  • 2021-05-28
  • 2021-04-22
  • 2021-04-08
  • 2021-04-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-10-26
  • 2022-03-03
  • 2022-01-17
相关资源
相似解决方案