← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #680864]: how to find list[] and if find remove the target

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
this would be my solution:

images = [image1,image2,image3]
count = 0
while True:
  matches = findAnyList(images)
  for match in matches:
    ix = match.getIndex()
    shot = capture()
    shotFile = 'change_%d-%d.png' % (count, ix)
    shutil.move(shot.getFile(), os.path.join(imageSave, shotFile))
    images.remove(ix)
  if len(images) == 0:
    break
  count += 1

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