Running other .sikuli scripts

Asked by Greg

Dear All,

I'm preparing an aplication using Sikuli which consists of few scripts:
1. Controller script
2. Global functions used across other scripts
and at least 5 actual scripts that do some action.

I want everything to run like this:
1. I'm launching controller script
2. It connects with external API using urllib2 and retrieves, which one of the x action scripts should be launched
3. Action script is executed
4. After the action script finishes we go back to 1.

I'm familiar with import and have read https://answers.launchpad.net/sikuli/+faq/2446 but this doesn't seem to fit my needs.
Does anyone have any idea how to achieve that?

Kind regards,
Greg

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
obiwan-92 (obiwan-92) said :
#1

Hello,

Two things :
 - First, you can put function in your called script, after you can call every time you want.
 - Secondly, you can use a loop to go back to your first point and execute the same actions.

The import of a function work like this :
import script2
script2.function()

The loop can work like this
for var in list: # where list contains the element to iterate on.
    print var

Hope it's help.
Regards.

Can you help with this problem?

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

To post a message you must log in.