FAQ
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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 4, '04 at 12:20a
activeFeb 4, '04 at 12:20a
posts1
users1
websitepython.org

1 user in discussion

Daniel Danger Bentley: 1 post

People

Translate

site design / logo © 2022 Grokbase