TypeError: iteration over non-sequence

Asked by TJL on 2010-01-29

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:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2010-01-29
Last reply:
2010-01-29
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.

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.