By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,768 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,768 IT Pros & Developers. It's quick & easy.


P: n/a

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:
(foo, bar, err) = popen2.popen3('cmd')
except Exception:

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.

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.