← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #411717]: can't repeat function inside while True

 

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

RaiMan proposed the following answer:
this simply does what it should.
So just check your code agains this template:

nMax = 3
nMain = 0

def sub():
  nSub = 0
  while True:
    # some additional code here
    # prepare break check
    nSub += 1 
    if nSub > nMax: break # check break condition
    print "sub:", nSub 
    # some additional code here

while True:
  # some additional code here
  # prepare break check
  nMain += 1
  if nMain > nMax: break # check break condition
  print "main:", nMain
  sub()
  # some additional code here

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.