← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #238896]: Passing multiple text arguments into Sikuli.

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
At least for version 1.0.1 this works already for the IDE:

- in the start-up splash screen you can enter in the parameter field:

-- test1 test2 test3

and in the IDE at script run the sys.argv contains the 3 strings
beginning at 1

e.g.
for e in sys.argv[1:]: print e 

will print 
test1
test2
test3

Be aware: if a parameter string contains blanks, you currently have to mask them with an otherwise unused character, that you replace before using the parameter, because the parameter handling uses space as delimiter.
This will be easier in version 1.1

e.g. parameters
test#me#now test2

will give with
for e in sys.argv[1:]: print e.replace("#", " ")

test me now
test2

using from command line:

runIDE -r some_script.sikuli -- test1 test2

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