← Back to team overview

sikuli-driver team mailing list archive

[Question #288405]: Calling script from script

 

New question #288405 on Sikuli:
https://answers.launchpad.net/sikuli/+question/288405

Hi,
maybe it is trivial question but it is not working for me and i tried many combination.

i have 2 scripts:
First:
def fib(n):    # write Fibonacci series up to n
    a, b = 0, 1
    while b < n:
        print b,
        a, b = b, a+b

def fib2(n): # return Fibonacci series up to n
    result = []
    a, b = 0, 1
    while b < n:
        result.append(b)
        a, b = b, a+b
    return result

def myPop(): # this defines a function
    popup("hello, I am script2")

#myPop()

Second:
from sikuli import *
myScriptPath = "c:\\Sikulix\\Testy"
addImportPath(myScriptPath)

import Fibo
reload(Fibo)

Fibo.fib(1000)
Fibo.myPop()

----------------------------------------------------------
Fibo.fib - is called and working
Fibo.myPop() - I am getting a err: 

[error] NameError ( global name 'popup' is not defined )
[error] --- Traceback --- error source first line: module ( function ) statement 18: Fibo ( myPop ) popup("hello, I am script2")
[error] --- Traceback --- end --------------

without () : Fibo.myPop ... i am not getting any error but popup is not displayed. 

Can you help me to find a bug? 

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.