[英]Python Tkinter window does not open when I run it with CMD
[英]cmd window always open when I open my .exe application
我完成了我的 python 應用程序並將其轉換為.exe 但是當我打開.exe 文件時,我發現 cmd window 也與應用程序 window 一起打開。我使用 python3.10 和 tkinter 也使用 auto-py-to-要轉換的exe
創建.exe時可以在命令中加上--noconsole標簽pyinstaller "other tags" --noconsole app.py
使用 win32gui 和 win32con 模塊,通過 pip install 安裝
import win32gui, win32con
the_program_to_hide = win32gui.GetForegroundWindow()
win32gui.ShowWindow(the_program_to_hide , win32con.SW_HIDE
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.