← Back to team overview

sikuli-driver team mailing list archive

[Question #262456]: Import multiple other scripts to Sikuli

 

New question #262456 on Sikuli:
https://answers.launchpad.net/sikuli/+question/262456

Hello fellow sikulians :)
I would like to import multiple other scripts to sikuli. I know Sikuli can only import one actually and I know with reload I can import again but I think it’s only works if  the “*. Sikuli” is in the same folder!?
Right now, I get an error: [error] AttributeError ( 'module' object has no attribute 'createSubFolders' ))
Preferably I would like to import using relative path :) 

Okay here is my directory structure…..
\sikuli\documents
                                  \File.sikuli				                         (main script)
                                  \Folders
                                                 \create.sikuli			         (first import)
                                                 \delete.sikuli			         (fifth import) 
                                                 \SubFolders
                                                                       \create.sikuli		(second import)
                                                                       \delete.sikuli		(fourth import)
                                  \Files
                                            \create.sikuli			                (third import)

And now my (main) script… 

#First import (works)
myScriptPath = "c:\\var\\www\\docuplus_testing\\sikuli\\documents\\Folders"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
import create
create.createFolder()

#Second import (It’s the subfolder)
myPath = "c:\\var\\www\\docuplus_testing\\sikuli\\documents\\Folders\\SubFolders"
if not myPath in sys.path: sys.path.append(myPath)
import create
create.createSubFolders()

Can anyone point out, what I’m doing wrong? I tried many different approaches and read many threads concerning this problem. Any idea is highly appreciated!


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