Run a set of lines multiple times using while

Asked by srijith on 2010-02-02

How to run a set of lines multiple number of times using while loop ?
like
while not find(img)

{
---------------
---------------
--------------
}

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
srijith
Solved:
2010-02-04
Last query:
2010-02-04
Last reply:
2010-02-03
Sergey Darovskih (darovskih) said : #1

use indents, and don't forget colon after condition:

while not find(img):
    dosomething()
    continuedoingsomething()
    etc()
dosomethingafterwhile()

srijith (electronicmails1) said : #2

The Solution is not clear.
How to close the statements inside while ?

I am getting Syntax error when I add while statement in SIKULI for Leopard , but I dont get this Syntax error for while statement in SIKULI for snow leopard.

Sergey Darovskih (darovskih) said : #3

the key is indents :)
when you use some spaces in the beginning of the string, Sikuli understands that it is a part of a while.

srijith (electronicmails1) said : #4

Ya! I just missed the indents
thnks