win32gui show and hide console python code example
Example 1: how to hide command console python
import ctypes
ctypes.windll.user32.ShowWindow( ctypes.windll.kernel32.GetConsoleWindow(), 0 )
Example 2: hide console in python build
Simply save it with a .pyw extension. This will prevent the console window from opening.