import ctypes whnd = ctypes.windll.kernel32.GetConsoleWindow() if whnd != 0: ctypes.windll.user32.ShowWindow(whnd, 0) ctypes.windll.kernel32.CloseHandle(whnd)
Python 隐藏控制台窗口
原文:https://www.cnblogs.com/shenji/p/14828652.html