Re: urllib, urlretrieve method, how to get headers?

2011-07-01 Thread Chris Rebert
On Fri, Jul 1, 2011 at 12:03 AM, Даниил Рыжков daniil...@gmail.com wrote: Hello, everyone! How can I get headers with urlretrieve? I want to send request and get headers with necessary information before I execute urlretrieve(). Or are there any alternatives for urlretrieve()? You can use

Re: urllib, urlretrieve method, how to get headers?

2011-07-01 Thread Peter Otten
Даниил Рыжков wrote: How can I get headers with urlretrieve? I want to send request and get headers with necessary information before I execute urlretrieve(). Or are there any alternatives for urlretrieve()? It's easy to do it manually: import urllib2 Connect to website and inspect

Re: urllib, urlretrieve method, how to get headers?

2011-07-01 Thread Даниил Рыжков
Thanks, everyone! Problem solved. -- Regards, Daniil -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib, urlretrieve method, how to get headers?

2011-07-01 Thread Даниил Рыжков
Hello again! Another question: urlopen() reads full file's content, but how can I get page by small parts? Regards, Daniil -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib, urlretrieve method, how to get headers?

2011-07-01 Thread Kushal Kumaran
On Fri, Jul 1, 2011 at 2:23 PM, Даниил Рыжков daniil...@gmail.com wrote: Hello again! Another question: urlopen() reads full file's content, but how can I get page by small parts? Set the Range header for HTTP requests. The format is specified here:

Re: urllib, urlretrieve method, how to get headers?

2011-07-01 Thread Chris Rebert
On Fri, Jul 1, 2011 at 1:53 AM, Даниил Рыжков daniil...@gmail.com wrote: Hello again! Another question: urlopen() reads full file's content, but how can I get page by small parts? I don't think that's true. Just pass .read() the number of bytes you want to read, just as you would with an

Re: urllib, urlretrieve method, how to get headers?

2011-07-01 Thread Даниил Рыжков
Thanks, everyone! Problem solved. -- Regards, Daniil -- http://mail.python.org/mailman/listinfo/python-list