Re: [sage-support] timing out a function or command

2011-04-04 Thread William Stein
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

Re: [sage-support] timing out a function or command

2011-04-04 Thread D. S. McNeil
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

[sage-support] timing out a function or command

2011-04-04 Thread tvn
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