Python .exe 文件打开命令窗口

cod*_*ler 1 python user-interface exe pyinstaller

我已经通过 .exe 文件编译了我的 python 脚本PyInstaller

问题是,现在运行.exe应用程序时,打开了两个窗口,一个是GUI界面还可以,但另一个是Windows命令窗口,我不想打开。

可能吗?

eme*_*eth 6

如果您使用的是 py2exe,

setup(windows=['your_code.py'], ...)
Run Code Online (Sandbox Code Playgroud)

代替console

请参阅使 py2exe exe 在没有控制台的情况下运行?

更新

pyinstaller手册

 -w, --windowed, --noconsole 
Run Code Online (Sandbox Code Playgroud)

使用窗口子系统可执行文件,在 Windows 上启动程序时不会打开控制台。在 Mac OS X 上创建 .app 捆绑包时,此选项是必需的。


roo*_*ook 5

如果您使用PyInstaller,请-w在构建应用程序时尝试使用option。