osx - What is an alternative to win32gui in python 2.7 for mac -
i using win32gui figuring out specific window has been opened or not in windows. want have same functionality in mac os also. in windows import win32gui win32gui.findwindow(class_name, window_name)
what equivalent lib in python 2.7 mac os?
i found solution above problem
from quartz import cgwindowlistcopywindowinfo, kcgnullwindowid, kcgwindowlistoptionall import datetime, time print datetime.datetime.now() found = false count = 0 windowname = "hello world" while 1: list = cgwindowlistcopywindowinfo(kcgwindowlistoptionall, kcgnullwindowid) time.sleep(0.2) in list: try: if a['kcgwindowname'] == windowname: print "**** yippee *****" print "window found" print found = true break except: pass if found == true: break print "not found", count count+=1 print datetime.datetime.now()