Progress urllib2

Denis S. Otkidach ods at strana.ru
Mon Aug 26 10:22:32 EDT 2002


On Mon, 26 Aug 2002, Bart Vandereycken wrote:

BV> Is it possible to see how much data an urllib2.urlopen
BV> command sends.
BV> I need to upload a large file using a POST form, and a
BV> feedback of the
BV> progress would be nice.
BV>
BV> Thnaks
BV>
BV> PS Python newbie, so don't just say: you need to rewrite
BV> urllib2 or
BV> urlopen ;-)

Certainly, you should rewrite httplib first and then change
urllib2 :-)
Just hack httplib.HTTPConnection._send_request() method to write
request in chunks and add some feedback to it.

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]
http://diveinto.python.ru/ [ru]





More information about the Python-list mailing list