pyinstaller使用教程

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.1PyQt5-codespackyundamaAPI.dll;''

6.添加图标

pyinstaller *.py -i **.ico


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

原文地址:https://www.cnblogs.com/Hubz131/p/10915973.html