← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #225559]: Import setting files in a main file

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Supposing:
-- you work with Sikuli IDE
-- have all .sikuli in the same directory
-- have the imported .sikuli containing the region settings open in the IDE, while working in another script

*** myRegions.sikuli

from sikuli import *
reg1 = Region(....)
reg2 = Region(....)
reg3 = reg2.below(300)
....

*** someScript.sikuli

import myRegions
reload(myRegions)
from myRegions import *

# now you can use all names defined in myRegions.sikuli as is

if (reg3.exists(some_image,0): print "going well"

Information on this feature: http://doc.sikuli.org/globals.html
#importing-other-sikuli-scripts-reuse-code-and-images

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