B
Brian Blais
Hello,
I'd like to do something like:
try:
execfile_timeout("somefile.py",5) # time out after 5 seconds
except TimeOutError:
print "this timed out!"
is there something that would do this? I'd like to call "somefile.py", but if it has
an infinite loop, I don't want to freeze at that point. If it helps, this part of
the code is already running in a thread, so I guess I could time-out the thread
rather than the execfile. Is there an easy way to do that?
thanks,
Brian Blais
I'd like to do something like:
try:
execfile_timeout("somefile.py",5) # time out after 5 seconds
except TimeOutError:
print "this timed out!"
is there something that would do this? I'd like to call "somefile.py", but if it has
an infinite loop, I don't want to freeze at that point. If it helps, this part of
the code is already running in a thread, so I guess I could time-out the thread
rather than the execfile. Is there an easy way to do that?
thanks,
Brian Blais