1、在使用之前首先安装Pyinstaller ,命令pip install pyinstaller
2、首先直接打包Python编辑的文件plan.py,pyinstaller plan.pydist文件夹中是plan.exe和相关的依赖项
3、使用-F参数打包pyinstaller -F plan.py在dist文件中,只有打包的exe文件,并且文件大小比之前的大
4、使用-D参数pyinstaller -D plan.py打包之后和没使用参数打包的结果一样,都是具有依赖项
5、使用-w参数pyinstaller -w plan.py使用此参数,在运行的时候cmd窗口不会弹出,关闭窗口显示的一个参数
6、-i参数的使用pyinstaller -w -F -i mm.ico plan.py使用此参数,是对打包的软件添加图标,在打包的时候,图标必须是.ico格式的文件
7、总结: pyinstaller打包的时候确实很方便使用,在没有Python运行环境下,打包的文件也可以使用