Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
myThread(ulrs[:100])
import urllib2
from multiprocessing.dummy import Pool as ThreadPool
urls = [
['http://www.python.org', "название нужной директории1"],
['http://www.python.org/about/', "название нужной директории2"],
['http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html', ,"название нужной директории3"],
['http://www.python.org/doc/', "название нужной директории4"]
]
# Make the Pool of workers
pool = ThreadPool(4)
def my_func(input):
get_http(input[0])
save_todir(input[1])
# Open the urls in their own threads
# and return the results
results = pool.map(my_func, urls)
#close the pool and wait for the work to finish
pool.close()
pool.join()
Разница в скорости в два раза слишком мала для скриптов. Вот 7-8 раз это уже разница.
Если не хватает скорости python, то в google используют go , java, C++.
https://www.quora.com/Which-programming-languages-...