You do not need a third-party library. Just create a thread for each request, start the threads, and then wait until they are all completed in the background, or continue the application while loading images.
import threading results = [] def getter(url, dest): results.append(urllib.urlretreave(url, dest)) threads = [] for x in range(0,10): t = threading.Thread(target=getter, args=('http://test.com/file %s.png' % x, 'temp/file %s.png' % x)) t.start() threads.append(t)
Optionally, you can create a thread pool that will receive urls and dests from the queue.
If you are using Python 3, it is already implemented for you in the futures module.
source share