#!/usr/bin/python import httplib, time from urlparse import urlparse loc = "http://noslor/ubuntu-7.04-desktop-i386.iso" file = open('output', 'wb') def main(): global loc, file connection = httplib.HTTPConnection(urlparse(loc)[1]) begin, size = 0, 10485700 place = begin end = begin + size connection.request('GET', urlparse(loc)[2]) response = connection.getresponse() start_t = time.time() while True: data = response.read(4096) place += len(data)