Ulli Horlacher <frams...@rus.uni-stuttgart.de>:

> Marko Rauhamaa <ma...@pacujo.net> wrote:
>
>> I'm thinking the only portable way is to run a watchdog process with
>> subprocess or multiprocessing.
>
> How can a subprocess interrupt a function in another process?
>
> For example: waiting for user input with a timeout.
>
> raw_input("Hit ENTER to continue or wait 10 s")

By sending the parent a signal with os.kill().

Now, signal handling in Python is brittle so you must be careful:

  There is no way to “block” signals temporarily from critical sections
  <URL: https://docs.python.org/2/library/signal.html>


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to