Is there a way to set up my script so that with one push button I can quit() my script? I am trying to fix my script but because I use input simulation I can't do control-D or using mouse clicks.
Thanks!
Is there a way to set up my script so that with one push button I can quit() my script? I am trying to fix my script but because I use input simulation I can't do control-D or using mouse clicks.
Thanks!
Try this:
>>> try:
... a = raw_input()
... except EOFError:
... print "Exited"
...
Exited
>>>
Use EOFError for control-D, KeyboardInterrupt for control-C.