Python:在背景中隐藏CMD

问题描述

这是我第一次创建应用程序,因此我不确定自己做错了什么。每次在exe中启动转换后的python时,如何删除或隐藏此命令提示符?

python

解决方法

感谢你们的链接。这对我有用: “编辑your_script.spec文件以摆脱控制台的局面。

exe = EXE(pyz,a.scripts,a.binaries,a.zipfiles,a.datas,name='main',debug=False,strip=False,upx=True,console=True )

只需将控制台值更改为False。然后运行:

pyinstaller your_script.spec”

来源:Getting rid of console output when freezing Python programs using Pyinstaller

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...