> I would like to execute shell commands, but only if their execution > time is not longer than n seconds. Like so: See example at http://docs.python.org/library/signal.html#example