← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #287091]: Problem with threading/multiprocessing --- use observe in background

 

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

    Status: Needs information => Answered

RaiMan proposed the following answer:
This would be a suitable way, to assure the thread terminates, if the
main terminates:

# --- main
shouldStop = False

# do some preparations

# start the thread

# do your work

# do your normal end procedure
shouldStop = True
wait(3)
exit()


# --- thread module
while not shouldStop:
    wait(1)
    if exists(scenario, 0):
          # do your logout/cleanup
          break

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