On Mon, Apr 4, 2011 at 11:27 PM, D. S. McNeil wrote:
> On Tue, Apr 5, 2011 at 1:47 PM, tvn wrote:
>> Is there a timeout mechanism in Sage or Python that allows me to kill or
>> raise an exception on a command that exceeds some time threshold ?
>
> You probably want "alarm", which raises a Keyboar
On Tue, Apr 5, 2011 at 1:47 PM, tvn wrote:
> Is there a timeout mechanism in Sage or Python that allows me to kill or
> raise an exception on a command that exceeds some time threshold ?
You probably want "alarm", which raises a KeyboardInterrupt.
Doug
--
Department of Earth Sciences
Universi
Is there a timeout mechanism in Sage or Python that allows me to kill or
raise an exception on a command that exceeds some time threshold ?Thanks
,
For example
try:
result = timeout(unpredictablefunction, 50)
except TimeoutException:
print 'terminated unpredictablefunction be