← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #689156]: Region question

 

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

    Status: Solved => Open

xyz_User is still having a problem:
I've decided to just do a count instead, it works perfectly however, I
have one small problem. If any ONE of these images doesn't exist i get
an error, that it wasn't able to find the image.

What can I do to make it count the total images, regardless if they were
found or not:

here's what i have so far

def countTargets(image):
    count = 0
    for i in findAll(image):
        count += 1
    return count
targetCount = countTargets("image1" or "image2" or "image3" or "image4")

if targetCount == 1:
    popup('found 1') 
elif targetCount == 2:
    popup('found 2')    
elif targetCount == 3:
    popup('found 3')   
elif targetCount == 4:
    popup('found 4')   
else:
    pass

Thank you

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