← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #151110]: importing .sikuli scripts won't import images

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
look at the specs (http://sikuli.org/docx/globals.html#importing-other-
sikuli-scripts-reuse-code-and-images) and read the text coming after:

"This is possible with Sikuli X:

    * import other .sikuli in a way that is fully compatible with Python import
    * import a python modul structure including underlying Java classes from a jar-file, that is dynamically loaded using the function load(jar-file)
    * automatically access images contained in the imported .sikuli (no need to use setBundlePath())"

carefully - the example might be helpful too.

your case:

myScriptPath = "Users/pbellamy"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
import browseto_url

I guess, the normal import works, because the main script is in
Users/pbellamy too and the Sikuli import looks in the current dir too.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.