Import not working on Debian 6.0.2.

Asked by Srikanth

I am trying to import the images stored in one script to another script. But somehow it is not working. I have stored all my images in Images1.sikuli. And I am trying to use the following script to import.

import os
myScriptPath = /some path/
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
from Images1 import *

Also please let me know, if we can use the images taken in one distro (say Ubuntu) to work on another distro (say Debian/Fedora).

Quick response is highly appreciated.

Thanks,
SSL

Question information

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

--- this is how import should work

myScriptPath = "/some absolute path/"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
from Images1 import *

where /some absolute path/Images1.sikuli is a script containing images, that was saved with Sikuli IDE.

--- images on other systems
wether images captured on one system, can be reused on others, cannot be answered generally. As long as the images are the same pixel by pixel on the other system it should work (usually the case inside a browser window for web content).
You have to try this out and in case it does not work use the import solution to have different sets of images.

Revision history for this message
Srikanth (srikanth-lokare) said :
#2

 Hi RaiMan,

 Thanks for the answer. But this is what I tried before (as you can see in the description) and is not working for me. I am getting the following error message.

 "File "/tmp/sikuli-tmp1038812797690406839.py", line 7, in click(PP) NameError: name 'PP' is not defined"

 Where "PP" is a name assigned to an image in Images1.sikuli script.

 Please let me know if any other solution to make it work.

Thanks and Regards,
SSL.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

-- you say: But this is what I tried before
Sorry, was only to be sure: see the difference: "/some absolute path/"

-- again, only to be sure
in Images1.sikuli you have:
PP = "some-image.png"

-- if it does not work
have a look at Image Search Path: middle of http://sikuli.org/docx/globals.html#general-settings-and-access-to-environment-information

Revision history for this message
Srikanth (srikanth-lokare) said :
#4

 Hi RaiMan,

Thanks for the answer. It started working when I closed and Reopened the script using Sikuli IDE.

Thanks again.

Regards,
SSL