check whenever a list contains images

Asked by Calle Rundgren

Hi, today I faced a problem when I am tried to search a list for a image declared by name.
I know I shall use python in order to controll whenever a object is visible inside a list:

    list = [1, 2, 3, 4, 5]
    3 in list
    True
    6 in list
    False

I am not really able to get this working with a list containing images in sikuli, but with lists only containing intergres in python and jython it works well. What am I doing wrong?

Question information

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

example for a list containing images in Sikuli:

list = ["image1.png", "image2.png", "image3.png"]

(in the IDE, the image thumbnails are shown, but if you hover over the image, the image's filename is displayed)

so
"image2.png" in list # should give True

and
"some-image.png" in list # should give False

Revision history for this message
Calle Rundgren (c-rundgren) said :
#2

Thank you, I forgot the "" around the string declared as the image.

Revision history for this message
Calle Rundgren (c-rundgren) said :
#3

Thanks RaiMan, that solved my question.