Question #235378 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/235378

RaiMan posted a new comment:
Sorry, my fault
(Screen(i) for i in range(Screen.getNumberScreens()))
is only the generator. to produce a list with it:
either
screens = [Screen(i) for i in range(Screen.getNumberScreens())]
or 
screens = list(Screen(i) for i in range(Screen.getNumberScreens()))

this would be my version:

def wait_multi_screens(image, wait_time):
    screens = [Screen(i) for i in range(Screen.getNumberScreens())]
    start_time = time.time()
    while (time.time() - start_time < wait_time):
        for s in screens:
            if s.exists(image, 0):
                return s.getLastMatch()
        wait(1)
    popup("[ERROR] Can't find the image on all the monitors.")
    raise

it returns the match in case of success, so you know, where your app is.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to