[Tutor] : breaking out of a function that takes too long

C or L Smith smiles at worksmail.net
Wed Sep 16 12:07:23 CEST 2009


>> Serdar wrote:
...
>> So again, is there a way to place a time limit on the execution of a
>> function, after which you can break out of it and then retry it or
>> move along with the rest of your program?

At http://tinyurl.com/rbre9n you can find a recipe that tells you how to decorate a function so it will return after a given amount of time. According to the comments, this will leave the process still running, but at least the whole program won't hang. I've used it successfully from time to time.

/c


More information about the Tutor mailing list