Greetings, I'm looking for a function in the standard library or pywin32 package that will block until a certain condition is met or it is interrupted by Ctrl-C. For example, time.sleep() would have been perfect for my needs if thread.interrupt_main() could interrupt the call from another thread in the same way that Ctrl-C does. Unfortunately, that is not the case.
Another thing I tried was creating a pipe with os.pipe() and issuing a read call on it. The event to exit was a single byte written to the other end of the pipe, but Ctrl-C could not interrupt the read call. The threading.Event class does not work for me, because it uses short sleep intervals for timed waits. I need the reaction to be as close to instant as possible, something like this will not do: while not <some condition is met>: sleep(0.01) I actually replaced threading.Event with my own version that uses native Windows events, and waits on those also cannot be interrupted by Ctrl-C. I'm trying to achieve the same effect as that while loop and I don't care what the condition to exit is, but the loop needs to exit as soon as the condition is met without waiting for up to X additional milliseconds. Any ideas? - Max -- http://mail.python.org/mailman/listinfo/python-list