【发布时间】:2017-01-31 17:49:59
【问题描述】:
我在 Mac 上使用 Sikuli IDE 1.0.0,试图让一个简单的测试用例工作,我在一个模块中从另一个模块调用脚本。 这些模块都在同一个目录中。
testModule.sikuli 有这个:
from sikuli import *
def testFunc():
exit(1)
testImport.sikuli 有这个:
import testModule
reload(testModule)
testModule.testFunc()
运行 testImport 只会产生:
[error] ImportError ( No module named testModule )
在导入 testModule 行。
我尝试了对 testImport 的各种添加,包括:
myScriptPath="[my project path]"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
这些似乎都不起作用。
【问题讨论】:
-
什么是
[my project path]?是 testModule.sikuli 的路径,还是 testModule.sikuli 所在目录的路径?
标签: sikuli sikuli-ide