sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #00186
Re: [Question #138472]: Trying to use system path for sikuli script and import it in other scripts.
Question #138472 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/138472
Status: Answered => Open
Anshu is still having a problem:
Hi RaiMan,
I am also back with same problem :( and also noticed something.
Like i said before - importing of scripts is working fine for me , when i use the sample code
# works on all platforms
p = getBundlePath()
slash = "\\" if Env.getOS() == OS.WINDOWS else "/"
myPath = p.rpartition(slash)[0] # gets the directory containing your running .sikuli
if not myPath in sys.path: sys.path.append(myPath)
# now you can import every .sikuli in the same directory
import myLib
But i want to put my sikuli script in folder : C:\Program Files (x86)\Sikuli X\libs
so that I need to use single statement in my scripts : "from myLib import *
But using this approach - i get the error that module myLib is not defined
;
so for testing purpose, i gave a print statement - print sys.path and it prints following line
['C:\\Program Files (x86)\\Sikuli X\\sikuli-script.jar', 'C:\\Program
Files (x86)\\Sikuli X\\Lib', 'C:\\Program Files (x86)\\Sikuli X\\sikuli-
script.jar\\Lib', '__classpath__', '__pyclasspath__/', '.']
- What appears wrong is "C:\\Program Files (x86)\\Sikuli X\\Lib" folder.
Under Sikuli X - the actual folder name is libs and not Lib; my scripts is also put under libs and not Lib folder.
Is that the root cause of the problem ???(confusion between libs and
Lib folder)
Thanks for being patient - to hear the same issue again.
Anshu
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.