pyinstaller打包后的exe运行怎么去掉弹出的dos窗口

来源:互联网 发布:陕师大网络教育 编辑:程序博客网 时间:2024/05/21 11:08

1.windows平台的话,先把.py改成.pyw。


2.如果是直接指定python文件进行pyinstaller打包的话,需要添加--noconsole

pyinstaller tools2.py --noconsole


3.如果想只打包成一个exe
pyinstaller -F tools2.py --noconsole

pyinstaller -F -w tools2.py
更换最终exe生成路径
在cmd中,一开始就要 cd D:\temp\ 切换到输出文件夹,然后在用上面的代码





原创粉丝点击