← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #332735]: how to call python script in SikuliX and viceversa?

 

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

RaiMan proposed the following answer:
With SikuliX the recommended way is to only use .sikuli folders
containing the .py file (same name), even if no images are used.

This allows to get the most comfortable approach:
see http://sikulix-2014.readthedocs.io/en/latest/scripting.html#importing-other-sikuli-scripts-reuse-code-and-images

# content of Function.sikuli
def printme( str ):
   print (str)
   return

# content of main.sikuli
import Function
Function.printme("I am first call to user defined function") # as danman mentioned in comment #1

or
from Function import *
printme("I am first call to user defined function")

the latter needs a proper naming convention to avoid conflicts

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