← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #209147]: if exists with try catch

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Is the above snippet the whole script?

If yes, then it needs a

from sikuli import *

at the beginning.

For using Eclipse with Sikuli look:
http://sikuli.org/docx/faq/040-other-ide.html

--- according images
when a script ( a .sikuli ) is run in the IDE the image path internally is set to the .sikuli folder (can be accessed via getBundlePath()).
When run in Eclipse (which means you are running it directly using Jython), you must tell Sikuli, where the images can be found.

If you are capturing the images in the IDE and save your script, then you are editing the contained .py in Eclipse, i suppose.
check, wether sys.argv[0] contains the absolute path to your script.
then you could use after the above import:

import os
setBundlePath(os.path.dirname(sys.argv[0]))

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