python生成exe文件

本文 介绍了 python如何生成exe文件

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

一、安装 pyinstaller

pip install pyinstaller

二、使用 pyinstaller 命令

pyinstaller -F main.py #打包成 exe
pyinstaller -F --icon=my.ico test.py #打包成 exe,并设置图标
pyinstaller -F -w yourfilename.py #打包成 exe, 且不包含控制台

一般 python GUI 编程才用到 打包成 exe

上一篇 下一篇


推荐文章

评论
说点什么吧?

发表评论

取消回复
  最新文章