1,安装pyinsatller
pip3 install pyinstaller
2,使用pyinstaller打包Python程序
pyinstaller -F -w (-i icofile) filename
filename表示你的Python程序文件名
-w 表示隐藏程序运行时的命令行窗口(不加-w会有黑色窗口)
括号内的为可选参数,-i icofile表示给程序加上图标,图标必须为.ico格式
icofile表示图标的位置,
3,若引用了其它包,把该包文件也放入该打包文件下