← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #165540]: getting error while use python language inside sikuli

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
When using the Sikuli IDE you only need to import modules, whose
features you want to use later on.

sys and time are already imported, so this is possible without importing:
print sys.path
print time.time()

your problem:

reg=Region(281,234,301,302)
img=capture(reg)
if exists(img):
    print "exists"

To show, which statements make up a block, Python uses indentation (use
one tab for one level)/dedentation (use shift-tab). This has to be done
after if/elif/else, while, for, try/except, def and some more control
statements.

To write more complex Sikuli scripts, you need some basic knowledge of
Python.

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