How to know a specific image found on a if exists with an array
Hello, i have this part of my code. I already posted it here a few days ago
(https:/
I have this array (ha =[]) with some images that i use to find on 2 determined regions (rHa and rHb). The code is working fine, but i want to know if there is any way to know which image my "if (existsAny(rHa, ha)" found. I mean if it found something i want to know what exactly.
Sorry i don't know how to explain it better and engish is not my 1st language.
Hope you guys understand what i mean.
Thanks
rHa = Region(
rHb = Region(
Settings.
rF= Region(
Settings.
mH = (Pattern(
mO = (Pattern(
mP = (Pattern(
mS = (Pattern(
kH = (Pattern(
kO = (Pattern(
kP = (Pattern(
kS = (Pattern(
nH = (Pattern(
nO = (Pattern(
nP = (Pattern(
nS = (Pattern(
ha = [] # <---- this array
ha.append(mH)
ha.append(mO)
ha.append(mS)
ha.append(kH)
ha.append(kO)
ha.append(kS)
ha.append(nH)
ha.append(nO)
ha.append(nS)
nh = [] #m (I use this later)
nh.append(mH)
nh.append(mO)
nh.append(mP)
nh.append(mS)
no = [] #k (I use this later)
no.append(kH)
no.append(kO)
no.append(kP)
no.append(kS)
np = [] #n (I use this later)
np.append(nH)
np.append(nO)
np.append(nP)
np.append(nS)
def existsAny(reg, imageList):
for img in imageList:
if (reg.exists(img, 0)):
return True
return False
count = 0
while (count < 1000):
rF.
img = Screen(
import shutil
shutil.move (img, 'c:/a/x(%d).png' % count)
count = count + 1
if (existsAny(rHa, ha) and existsAny(rHb, ha)):
#print the img that the above if found <------ HERE
else:
Again, thanks!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by Luiz
Can you help with this problem?
Provide an answer of your own, or ask Luiz for more information if necessary.