← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #660277]: How to use functions from the main script?

 

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

RaiMan proposed the following answer:
I think this way it makes more sense:

Assuming that you want to call a function present in sub.sikuli from
main.sikuli , your solution could be similar to this

sub.sikuli ::
from sikuli import * # needed in imported scripts
def doSomething():
    return(123) # what should be done in main.test

main.sikuli ::
import sub
def test():
    sub.doSomething() 
test() # should print 123

take care that main.sikuli and sub.sikuli are in the same folder

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