TypeError: iteration over non-sequence

Asked by TJL

every time i try to do a for
exmpl:
xs = find( )
for x in xs:
   click(x)
or
for x in find( ):
   click(x)

i get this error:
TypeError: iteration over non-sequence

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sergey Darovskih (darovskih) said :
#1

If find() founds only one match, it cannot iterate through it, try click(find( )).

But I also couldn't force find() to return a sequence - it always says

"capture: java.awt.Rectangle[x=0,y=0,width=1280,height=1024]
1 matches found"

even if picture has 5-6 matches on the screen.

Revision history for this message
Sergey Darovskih (darovskih) said :
#2

use findAll()

Can you help with this problem?

Provide an answer of your own, or ask TJL for more information if necessary.

To post a message you must log in.