How to stop a Python program after some arbitrary timeout
<p>Just for instance, this code is working</p>

<pre><code>import urllib

image = urllib.URLopener()
file_ = 1
name = 1
for i in range(1,1000):
    try:
        image.retrieve("http://mangawriter.com/pics/pic"+str(file_)+".jpeg","pic"+str(name)+".jpeg")
        print "save file %s" %file_ 
        name += 1
        file_ += 1
    except IOError:
        file_ += 1
</code></pre>

<p>How could I make it stop after some time was spent, even if the code is still being ran? Please, help me to figure it out.</p>
