← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #249144]: App() is not defined in imported def

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Look docs.

Von meinem iPhone gesendet

> Am 22.05.2014 um 21:06 schrieb core <question249144@xxxxxxxxxxxxxxxxxxxxx>:
> 
> New question #249144 on Sikuli:
> https://answers.launchpad.net/sikuli/+question/249144
> 
> [error] script [ test ] stopped with error in line 4
> [error] NameError ( global name 'App' is not defined )
> 
> test.sikuli:
> 
> myScriptPath = "c:\\Sik\\test\\testLIb"
> if not myScriptPath in sys.path: sys.path.append(myScriptPath)
> import testLib
> testLib.testFn()
> 
> 
> testLib.sikuli:
> 
> def testFn(): 
>    testpad  = App("calc.exe")
>    App.open(testpad) 
>    popup("Test Fn")
>    return()
> 
> 
> 
> 
> When the def is in the  main sikuli, it works without error.
> 
> test2.sikuli:
> 
> def testFn(): 
>    testpad  = App("calc.exe")
>    App.open(testpad) 
>    popup("Test Fn")
>    return()
> 
> testFn()
> 
> 
> Why the error when using an imported sikuli fn?
> 
> -- 
> You received this question notification because you are an answer
> contact for Sikuli.

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