Segmented downloading when downloading large files will speed up the download process , Almost all downloadable software has similar features . stay python How to realize segmented file downloading in ?
>>> import urllib2 >>> req = urllib2.Request('http://www.python.org/') download 19000 To 20000 Fragments of bytes >>> req.headers['Range'] = 'bytes=%s-%s' % (19000, 20000) >>> f = urllib2.urlopen(req) >>> pagerange = f.headers.get('Content-Range') >>> print pagerange bytes 19000-19189/19190 >>> print repr(f.read()) '</div>\n\tCopyright © 1990-2012, <a href=\'/psf/\'>Python Software Foundation</a><br/>\n\t<a href="/about/legal">Legal Statements</a>\n </div>\n\n\n </div>\n </div>\n</body>\n</html>\n\n\n\n\n\n\n' >>> </pre>