Advertisement
calfred2808

hide cmd window while running exe in python code example

Aug 7th, 2022
685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. # pip install pywin32 -> This will install the libs that are required
  2. import win32gui, win32con
  3.  
  4. hide = win32gui.GetForegroundWindow()
  5. win32gui.ShowWindow(hide , win32con.SW_HIDE)
  6.  
  7. #or Simply save it with a .pyw extension. This will prevent the console window from opening
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement