stop input after a few time

Asked by aorior

Hi,
I would like to stop input after a few time.
I mean that I ask user a question and if he doesn't answer after a few time, the script continue without this information.
I read something about Thread but I don't actually understand.
So if someone has another solution, or could help me?
Aorior.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
aorior
Solved:
Last query:
Last reply:
Revision history for this message
aorior (quentin26om) said :
#1

I do that:
import threading
class MT (threading.Thread):
    def __init__ (self,Fenetre):
        threading.Thread.__init__ (self, target=self.run)
    def run (self):
        globar myVar
        myVar=input("?????????")
    def stop(self):
        self._stopevent.set( )
TH=MT(run)
TH.start()
wait(2)
click("1404739259247.png")
where 1404739259247.png is the buttom ok
That seem to work.