IF syntax error

Asked by ralph wong

setAutoWaitTimeout(10000)
rightClick( )
click( )
if find( ):
click( )
else:
click( )

running win7 64bit... tried if else a couples, all get syntax error..
[sikuli] [Error] Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('C:\\Users\\R@lph\\AppData\\Local\\Temp\\sikuli-tmp1708311564224411534.py', 5, 1, 'click("1271567988781.png")'))

please help~~ thanks~~

Question information

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

it is python language, you are using.

so you have to indent the next lines, belonging to the if/else/elif/while/for block:

setAutoWaitTimeout(10000)
rightClick( )
click( )
if find( ):
   click( )
else:
   click( )

Revision history for this message
ralph wong (ralphw0ng) said :
#2

thanks problem solved

i thought didn't need intent for python :D