← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #206597]: Problem with importing "external" modules

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
I just made some tests on my Mac and the solution using the version with
the Test1.sikuli worked for me.

I cannot test on Windows currently and the next days, so I can only ask
you, to make some basic tests, wether your approach principally works.

# main.sikuli in some_directory
import os
dir = os.path.dirname(getBundlePath())
importDir = os.path.join(dir, "Tests")
if not importDir in sys.path:
    sys.path.append(importDir)
exec("import Test1")

# Test1.sikuli in some_directory\Tests\
print "I am imported now"

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