execfile time out?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian Blais

    #1

    execfile time out?

    Hello,


    I'd like to do something like:

    try:
    execfile_timeou t("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.p y", 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

    --
    -----------------

    bblais@bryant.e du

Working...