← Back to team overview

sikuli-driver team mailing list archive

[Question #245803]: Import Error: Expecting Newline

 

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

I have created a "utility" class that can be called from multiple scripts.  It is call "cUtil.sikuli" 

from sikuli import *
from ConfigParser import *

class cUtil:
     def readConfig(self):
        .
        .
        .
       return;

and so on.
----------------------------------------------
I have a main script called "AutoTest" where I am calling certain functions from the class.  It starts:

from sikuli import *
myScriptPath = "C:\\Sikuli\\cUtil.sikuli"
from cUtil import *
-----------------------------------------------------------
Both scripts are found in the C:\Sikuli directory, but when I run AutoTest, I receive:

[error] Stopped
[error] An error occurs at line 5
[error] Error message: Traceback (most recent call last):
File "C:\Windows\Temp\sikuli-tmp6604384538494479748.py", line 5, in 
from cUtil import *
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py", line 45, in load_module
File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py", line 29, in _load_module
ImportError: Errors in loading sikuli module: cUtil
mismatched input '=' expecting NEWLINE (cUtil.py, line 5)
- HOW TO FIX? Try adding "from sikuli import *" in the module.
-----------------------------------------------------------
Any help you could give me would be greatly appreciated.


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