← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #682255]: Custom theading best practices

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
this is my test on Windows 10/Java 12:

import threading
def myTask():
    n = 0
    while True:
        print n
        n += 1
        wait(1)    
taskThread = threading.Thread(target = myTask)
taskThread.start()
while True:
    wait(1)

When running the script from inside IDE:
Using alt-shift-c (abort key) terminates everything and returns to the IDE

When running the script from commandline:
Problem:  alt-shift-c (abort key)  currently does not work (I have to fix this)
... but ctrl-c allows to terminate the complete run (with an additional confirmation when using a batch script)

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