Getting syntax error

Asked by balakrishnan

Hi

I used the below code to run the test case serially . However when i use this code it says syntax error .Please let me know why it is giving syntax error.

import os
dir = "absolute-path-to-directory-containing-the-scripts"
scripts = ["script1", "script2", "script3", "script4", "script5"]
isPassAll = {}

for script in scripts:
    isPass = False
    scriptPath = os.path.join(dir, script+".sikuli")
    setBundlePath(scriptPath)
    execfile(os.path.join(scriptPath, script+".py")
    isPassAll[script] = isPass # syntax error is showing here #
print isPassAll

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

Post the error message (might be a indentation error).

Revision history for this message
balakrishnan (abkblr) said :
#2

[error] An error occurs at line 10
[error] Error message: SyntaxError: ("no viable alternative at input 'isPassAll'", ('C:\\DOCUME~1\\OMSRIR~1\\LOCALS~1\\Temp\\sikuli-tmp1416324575619369489.py', 10, 4, ' isPassAll[script] = isPass \n'))

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

in the line
    execfile(os.path.join(scriptPath, script+".py")

a trailing bracket is missing
    execfile(os.path.join(scriptPath, script+".py"))

Can you help with this problem?

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

To post a message you must log in.