← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #266772]: while not exists() or not exists(): does not seem to work

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
while not exists(AN IMAGE THAT DOESN'T EXIST,0) or not exists(AN IMAGE
THAT EXISTS,0):

will loop until both images exist, because as long as either of the images does not exist, <not exists()> is true and hence
the complete or is true

false or false is false
true or false is true
false or true is true
true or true is true

and your example is like a self fulfilling prophecy ( not this>3 is
always false)

your example made more real and comparable:
this = 1
that = 2
while not this>3 or not that>5:
    print this, that
    that += 1
    this += 1
    print "not this>3", not this>3
    print "not that>5", not that>5

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