python put console window on top

Solutions on MaxInterview for python put console window on top by the best coders in the world

showing results for - "python put console window on top"
Javier
04 Aug 2020
1import win32gui, win32process, win32con
2import os
3
4windowList = []
5win32gui.EnumWindows(lambda hwnd, windowList: windowList.append((win32gui.GetWindowText(hwnd),hwnd)), windowList)
6cmdWindow = [i for i in windowList if "c:\python26\python.exe" in i[0].lower()]
7win32gui.SetWindowPos(cmdWindow[0][1],win32con.HWND_TOPMOST,0,0,100,100,0) #100,100 is the size of the window