I have a list.
symbols = ('GGP', 'JPM', 'AIG', 'AMZN','GGP', 'rx', 'jnj', 'osip')
URL = "http://www.Xxxx_symbol=%s"
def fetch(symbols):
try:
url = URL % '+'.join(symbols)
fp = urllib2.urlopen(url)
try:
data = fp.read()
finally:
fp.close()
return data
except Exception as e:
print "No Internet Access"
I am trying a multi-threaded (with 4 threads) sampling process, not a multi-processor one and not using twisted. Url fetch - csv output file with 7 lines of header information I want to get rid of. I would like to loop each character in my own file. I used to use this code. I can get a list of characters that has one item.
source
share