← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #173070]: about Flow Control

 

Question #173070 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/173070

    Status: Open => Answered

RaiMan proposed the following answer:
if I understand your > notation right, your current code is either

A > 1 > 2 > 3 > A (no error, device.png exists)

or

A > 1 > X (error, X means exit ???, device.png does not exists)

If you want to have:

A>1>2>1>2>1>2>1>...

you need another loop and a condition, that ends this loop

e.g.
for i in range(n):
    # some code
    # A
    while some_condition:
        # 1
        # 2

or

for i in range(n):
    # some code
    # A
    while True:
        # 1
        if some_condition: break
        # 2
        if some_other_condition: break

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