I'm downloading multiple SMI files from a database called ZINC using a rather simple code I wrote. However, its speed doesn't look like so good considering the size of files (a few kb) and my internet connection. Is there a way to speed it up?
import urllib2
def job(url):
''' This function opens the URL and download SMI files from ZINC15'''
u = urllib2.urlopen(url) # Open URL
print 'downloading ' + url # Print which files is being downloaded
with open('output.smi', 'a') as local_file:
local_file.write(u.read())
with open('data.csv') as flist:
urls = ['http://zinc15.docking.org/substances/{}.smi'.format(str(line.rstrip())) for line in flist]
map(job, urls)