← Back to team overview

sikuli-driver team mailing list archive

[Question #660277]: How to use functions from the main script?

 

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

Hello! Sorry for my english.

I have 2 files in the same folder: main.sikuli and second.sikuli

# --- main.sikuli:
def test():
    return(123)

import second
reload(second)
from second import *
startSecondScript()

# --- second.sikuli:
from sikuli import *
def startSecondScript():
    import main
    from main import *
    y = test()

Result:
[error] script [ main ] stopped with error in line 7
[error] NameError ( global name 'test' is not defined )

How my second script can use functions from main script?

Thanks in advance!


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