threads and timeout -> running a shell command / want to guard againstinfinite loops

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marcus Liddle

    threads and timeout -> running a shell command / want to guard againstinfinite loops

    <newbie hat>

    Hi

    I'm trying to get a really simple python program to
    run a bash testing script and kill itself if its
    been running to long (ie infinite loop)

    create the thread object - test = TestThread()
    run the command - test.do_command ("infloop.bash" )
    if t.isAlive(): ...stop it

    any good ideas?

    cheers
    Marcus
    --
    Senior Assistant [mailto:m.liddle @cosc.canterbur y.ac.nz]
    Dept. of Computer Science University of Canterbury
    Phone: +64 3 366-7001 ext: 7871 Office: 323
    [ http://www.cosc.canterbury.ac.nz/~marcus/index.html ]


  • Tim Ottinger

    #2
    Re: threads and timeout -&gt; running a shell command / want to guard against infinite loops

    On Tue, 19 Aug 2003 14:21:14 +1200, Marcus Liddle wrote:
    [color=blue]
    > <newbie hat>
    >
    > Hi
    >
    > I'm trying to get a really simple python program to
    > run a bash testing script and kill itself if its
    > been running to long (ie infinite loop)
    >
    > create the thread object - test = TestThread()
    > run the command - test.do_command ("infloop.bash" )
    > if t.isAlive(): ...stop it
    >
    > any good ideas?[/color]

    Have you considered pexpect?

    Comment

    Working...