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

Tim Ottinger tottinge at indy.rr.com
Tue Aug 19 06:32:19 CEST 2003


On Tue, 19 Aug 2003 14:21:14 +1200, Marcus Liddle wrote:

> <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?

Have you considered pexpect? 





More information about the Python-list mailing list