am i doing this right?

Asked by eliteSKL

OS: windows 7, have yet to try it in windows xp

okay i'm having a hard time doing this. i made it work but i want to know if i'm doing it the correct way.

i have my files setup like this:

___________
file # 1
___________

#mainfile
sys.path.append(r""path to normal folder containing ".sikuli"'s)
from clickevent import *

clickevent()

___________
file # 2
___________
#class/function file

from sikuli.Sikuli import *
#####sys.path.append("path to normal folder containing ".sikuli"'s) <-- this doesn't work i have to use setbundlepath
setBundlePath("path to normal folder containing the imageLib.Sikuli) <--- I have to use this instead... why?
from imageLib import *

def clickevent():
      click(button)
___________
file # 3
___________
#imageLib file

from sikuli.Sikuli import * <--- if this is just an image library do i still need this statement?

button = "IMAGE.png"

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

every where you reference it's contents:
import functionlibrary
import imagelibrary

sys.path.append() only needed once in main file

from sikuli.Sikuli import *
only needed in files where you USE sikuli features.

Can you help with this problem?

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

To post a message you must log in.