while syntax doesnt work as expected

Asked by srijith

while find( image):
    popup("found")
popup("not found")

Here if the image is not found it shud popup "not found" . But instead Sikuli comes out and gives error in log as image not found.

Mac OS x Leopard Sikuli 10.0

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
srijith
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

As a default find() raises exception FindFailed.

If you only want to check, wether an image exists, use exists() instead (returns True/False, won't raise exception)

workflows containing "while exits():" may be check wether the new observer feature could be used instead.

It is a good idea to red through the new reference doc (http://sikuli.org/guide)

Revision history for this message
srijith (electronicmails1) said :
#2

Thnks!!