sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #04243
[Question #166490]: path wrong when doing import in a skl file
New question #166490 on Sikuli:
https://answers.launchpad.net/sikuli/+question/166490
Hello
I'm following the document to import .sikuli file
there are 2 files:
one is import.sikuli, code is:
import os
myPath = os.path.dirname(getBundlePath())
if not myPath in sys.path: sys.path.append(myPath)
import myLib
popup(myLib.getStr())
and anotner one is myLib.sikuli, the code:
from sikuli.Sikuli import *
def getStr():
return "string in myLib"
it works fine when I open the IDE and running it
and then I export the import.sikuli as import.skl, put it in the same folder to myLib.sikuli
but the import.skl is not running as expected
a error message was shown:
File "/var/folders/0R/0RZYxv8AEvKtC7Ln-CBw6++++T1/-Tmp-/tmp--180056268.sikuli/import.sikuli/import.py", line 6, in <module>
import myLib
ImportError: No module named myLib
then, I put one line before import myLib in import.sikuli:
popup(getBundlePath())
export it as .skl, then run it, I see the path is wrong, the popup window shows:
/var/folders/0R/0RZYxv8AEvKtC7Ln-CBw6++++T1/-Tmp-/tmp--180056268.sikuli/import.sikuli
how could I fix it ?
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.