python生成exe文件的方法:首先安装pyinstaller,代码为【pip install pyinstaller】;然后使用pyinstaller命令打包成exe【pyinstaller -F --icon=my.ico..】。

本教程操作环境:windows7系统、python3.9版,DELL G3电脑。

python生成exe文件的方法:

一、安装 pyinstaller

  pip install pyinstaller

二、使用 pyinstaller 命令

  pyinstaller -F --icon=my.ico test.py #打包成exe,并设置图标

  pyinstaller -F -w yourfilename.py #打包成exe,且不包含控制台

其他参数:

aa1e63a3490bc986d4b1cd4ce14c5ff.png

一般 python GUI编程才用到 打包成exe,讲道理不如.net 的winform好使

相关免费学习

python如何生成exe文件