def __len__(self):
    return self._total

def read(self, size):
    data = file.read(self, size)
self._callback(self._total, len(data), *self._args)
return data
path = 'large_file.txt'
progress = Progress()
stream = file_with_callback(path, 'rb', progress.update, path)
req = urllib.request.Request(url, stream)
res = urllib.request.urlopen(req)
urllib2 Мониторинг выполнения POST