← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #634207]: Change variable in onChange

 

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

Description changed to:
I have a loop running while at the same time observing a region on my
screen:

def changed(event):
    restart=True 

restart=False
region.onChange(100, changed)
region.observe(background=True)

while True:
    if restart:
        #do stuff
    else:
        #do other stuff

region.stopObserver()

This code does not seem to work, ie the value of "restart" is not
updated or is not picked up by the while loop.

How could I make this work?

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