title: Downloading over 1000 files in python
body: <p>So, maybe start from my code:</p>
  
  <pre><code>def download(fn, filename, index):
      urllib.request.urlretrieve(fn,
                       os.path.join('music', re.sub('[%s]' % ''.join(CHAR_NOTALLOWED), '', filename) + '.mp3'))
      print(str(index) + '# DOWNLOADED: ' + filename)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>for index, d in enumerate(found):
      worker = Thread(target=download, args=(found[d], d, index))
      worker.setDaemon(True)
      worker.start()
  worker.join()
  </code></pre>
  
  <p>My problem is that when I tried to download over 1000 files I always get this error, but I don't know why:</p>
  
  <pre><code>Traceback (most recent call last):
    File "E:/PythonProject/1.1/mp3y.py", line 238, in &lt;module&gt;
      worker.start()
    File "E:\python34\lib\threading.py", line 851, in start
      _start_new_thread(self._bootstrap, ())
  RuntimeError: can't start new thread
  </code></pre>
  
  <p>I tried using a queue, but got the same error.... I wanted part this thread but I don't know how :O </p>