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

M

Marcus Liddle

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

Tim Ottinger

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

marcus.liddle

<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:[email protected]]
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 ]

Well you might try reroute the encryption subprocessors manually, but you'dhave to leave the The Code Matrix in order to do that. Have you tried brushing you teeth and putting the cap back on? The things people for SEO huh? It would appear my Author ranked name appears here, so I thought my future-self would reply to my past self, thus applying entanglement theory, wave force particle acceleration to bend the fabric of the universe as we know it, blowing the infinite loop out of existence. -- thank you MrGoogle
-- thank you Marcus Liddle
(no relation to Alice Liddle from the Liddle House)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top