← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #248290]: Recursive Processing of a List

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Since you have said, that the next entry of the list should be in item
(for item in list), you have to use it in the type: type(item)

Am 20.05.2014 um 01:41 schrieb Joe Murphy:

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

   Status: Answered => Open

Joe Murphy is still having a problem:
Well, I tried some different things with your help, but I've failed.  :(

This is the closest I've managed to get (down below), but it almost
immediately halts with the following error when I want it to type the
first item in the list:

[error] script [ *Untitled ] stopped with error in line 6
[error] TypeError ( type(): 1st arg can't be coerced to String )

What I'm trying to do is have it loop through the lst, and use the same
item in the lst for all the type(text) and then have it loop back
through again.

Scratching my head and feeling dumb,

Joe


==========================================================

lst = ["Batch - Allegany Ballot Sytle 1", "Batch - Allegany Ballot Sytle 3", "Batch - Allegany Ballot Sytle 4", "Batch - Allegany Ballot Sytle 6"]
for item in lst:
       click("1400538997860.png")
       click("1400539015092.png")
       wait("1400539035645.png")
       type(text)
       click("1400539361509.png")
       wait("1400539035645.png")
       type(text)
       click("1400539361509.png")
       wait("1400539035645.png")
       type(text)
       click("1400539361509.png")
       wait("1400539035645.png")
       type(text)
       click("1400539361509.png")
       wait("1400539035645.png")
       type(text)
       click("1400539361509.png")
       wait("1400539035645.png")
       type(text)
       click("1400539361509.png")

-- 
You received this question notification because you are an answer
contact for Sikuli.

You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.