I want to download a file from the net, i.e.: http://www.malwaredomainlist.com/hostslist/ip.txt and put that in a list to further manipulate the items in the list.
I tried
print "Downloading with urllib2"
f = urllib2.urlopen(malwareurl)
data = [f.read()]
result = [stuff.replace("\r\n", "/32,") for stuff in data]
print result
print len([result])
the list itself "looks" fine:
['100.42.50.110/32,103.14.120.121/32,.......']
but the length is only 1.
I think I need to loop through the readlines and create items in the list for each readline, correct?