I use the following code to stream large files from the Internet to a local file:
fp = open(file, 'wb') req = urllib2.urlopen(url) for line in req: fp.write(line) fp.close()
This works, but it loads rather slowly. Is there a faster way? (The files are large, so I do not want to keep them in memory.)
python file urllib2 streaming
hoju 04 Oct '09 at 10:50 2009-10-04 22:50
source share