In Sikuli call a dictionary in a different file

Asked by Jonathan

Hi,

I have a dictionary called jondict that is located in ./dictexample.sikuli/dictexample.py
How can I go about using jondict in a sikuli script that is located in ./testcase1.sikuli/testcase1.py

I am running Sikuli on Windows XP

All help is appreciated.

Thanks

J

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

easiest way:

execfile("absolute-path-to-a-file-containing-sikuli-code")
this executes the statements as if they were in your running script in the place of execfile(). A relative path does not work in this case, because it is not the path to the running script.

the problem are the images, because e.g. find("image-file-name") searches the images in the path, where the main script (in your case testcase1.py) is located.

So if dictexample.sikuli contains any image files, these can only be located, if they are referenced with its absolute path or relative to the path of the main script (testcase1.sikuli here).

For more information look at my bug 627986 report.

Can you help with this problem?

Provide an answer of your own, or ask Jonathan for more information if necessary.

To post a message you must log in.