当我打开.EXE应用程序时,CMD窗口始终打开

发布于 2025-01-25 09:41:19 字数 109 浏览 4 评论 0原文

我完成了Python应用程序,然后将其转换为.exe 但是,当我打开.exe文件时,我发现CMD窗口也在应用程序窗口中打开。 我使用了python3.10和tkinter 还使用自动py-to-exe转换

I finished my python application and I converted it to .exe
but when I open the .exe file, I found that the cmd window is also open with the application window.
I used python3.10 and tkinter
also used auto-py-to-exe to convert

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

哆啦不做梦 2025-02-01 09:41:19

创建.exe
时,您可以将-noconsole标签添加到命令中
pyinstaller“其他标签” - noconsole app.py

You can add the --noconsole tag to the command when creating the .exe
pyinstaller "other tags" --noconsole app.py

赢得她心 2025-02-01 09:41:19

使用Win32Gui和Win32Con模块,通过PIP安装安装它

import win32gui, win32con

the_program_to_hide =  win32gui.GetForegroundWindow() 
win32gui.ShowWindow(the_program_to_hide , win32con.SW_HIDE

Use win32gui and win32con modules, installing it by pip install

import win32gui, win32con

the_program_to_hide =  win32gui.GetForegroundWindow() 
win32gui.ShowWindow(the_program_to_hide , win32con.SW_HIDE
半衾梦 2025-02-01 09:41:19
  1. 在文本编辑器中打开您的main.spec文件。
  2. 更改console = true to console = false

“像this”

  1. open your main.spec file in text editor.
  2. change Console=True to Console=False

like this

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文