← Back to team overview

sikuli-driver team mailing list archive

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

 

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

Hi RaiMan,


I have defined one function in python script.

Function.py is the python script file name.

def printme( str ):
   print (str)
   return 

I have call this printme(str) function in SikuliX IDE as follows:

import sys
mySikuliPath = "C:\Users\infodba\Desktop\SikuliX\Function.py"
if not mySikuliPath in sys.path: sys.path.append(mySikuliPath)
import Function
printme ("I am first call to user defined function")

I have kept Function.py file in same SikuliX IDE folder where my SikuliX script is there.

When I am trying to execute Sikulix Script I am getting error as follows:

[error] script [ temp ] stopped with error in line 5
[error] NameError ( name 'printme' is not defined )

Please help me on this and let me know if you have sample code or any document link avialable.

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