time-out

  • Thread starter Daniel Danger Bentley
  • Start date
D

Daniel Danger Bentley

Hi,

I'm writing a grading script for a class. Essentially, I wish to iterate
through all the submissions, run them, and grab the output. HOWEVER, some
of them loop forever, and I want the grading run to (mostly) complete.

So I guess my questions are these:
A) How do I timeout on a read?
B) failing that, how do I have multiple threads and each run wihtout running
into problems with having too many open files?
C) failing that, how do I pause or somehow add handling code so that I don't
clobber everything.

At the moment I have:

while 1:
try:
(foo, bar, err) = popen2.popen3('cmd')
except Exception:
pass

BUT that leaves me with open files. But if I try to free them, I get
unbound variable errors. Surely this has been done before, but I don't see
the (one) obvious way.

Thanks,
Dan
 

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
474,176
Messages
2,570,947
Members
47,501
Latest member
Ledmyplace

Latest Threads

Top