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

    Status: Open => Answered

Roman Podolyan proposed the following answer:
Learn Python try ... except .

https://docs.python.org/3/tutorial/errors.html#handling-exceptions

Here is how I handle it:

def try_click(our_image):       
    try:
        click(our_image)
        return True; 
    except FindFailed:
        return False 

If this code finds image, it clicks it and returns True. If  does not
find image, it just returns False, no Click executed.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to