<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;Simple question: Is it possible to stop a running function after certain<br>&gt;predefined time?
<br>&gt;<br>&gt;I would like to convert this routine to Python using pycurl module, or maybe<br>&gt;even standard urllib.urlretrieve. </blockquote><div><br>
<br>
</div></div>If you use urllib.urlretrieve, you can pass in a callback
function that gets called after every few blocks are downloaded. In
that function, you could check how&nbsp; much time has passed since the
download started, and quit the download if necessary. You should be
able to do this without threads. I'm not sure how you stop a download
once it's started though!<br>
<br>
Olly<br>
<br>