← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #663380]: Error of 2nd arg can't be coerced to String[] when try to use sys.argv

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Uuups, sorry for the misleading of the discussion.

The problem is built-in by the one, who implemented runScript (guess who
;-)

The parameters given to runScript are internally just taken as is. Each
parameter must be a string. Lists(arrays) are taken as is and not
resolved into their parts.

so your 
runScript("D:/KT_Work/Sikuli/tempTest.sikuli",mylist)

will never work with the current implementation.

You either have to say:
runScript("D:/KT_Work/Sikuli/tempTest.sikuli", pt1, pt2, pt3)

and ptx must be something like
""25, 225"

and you have to recover the list behavior in the target script using
split(",").

or you use another parameter convention, that completely is based on
strings.

And another option finally is:
parameters = "(%s, %s, %s)"%(pt1, pt2, pt3)

... and use
runScript("D:/KT_Work/Sikuli/tempTest.sikuli", parameters)

... and in the target script:
parameters = eval(sys.argv[1])

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.