On Sun, Oct 14, 2012 at 5:44 AM, Ray Jones wrote:
>
> I have often used help() to find my way around imported libraries. I
> didn't realize it would also help with instances. That's good to know.
help(e) shows info for the instance's class, such as methods and data
descriptors (i.e. properties, s
On 10/14/2012 02:26 AM, eryksun wrote:
> e.hdrs['connection'] 'close'
> e.hdrs.getheaders('connection') ['close']
I have often used help() to find my way around imported libraries. I
didn't realize it would also help with instances. That's good to know.
Ray
__
On Sun, Oct 14, 2012 at 2:15 AM, Ray Jones wrote:
>
> I can iterate through e.info() with a 'for' loop, but all I get as a
> result is:
>
> connection
> content-type
> www-authenticate
> content-length
urllib2.HTTPError inherits from both urllib2.URLError and
urllib.addinfourl (see help(e)). An i
On 10/13/2012 11:55 PM, Brian van den Broek wrote:
> On 14 October 2012 02:15, Ray Jones wrote:
>> On 10/13/2012 07:50 PM, Steven D'Aprano wrote:
>
>
>>> If you can do `print e.info()`, then you can also do `info = e.info()`
>>> and inspect the info programmatically.
>>>
>> One would expect that
On 14 October 2012 02:15, Ray Jones wrote:
> On 10/13/2012 07:50 PM, Steven D'Aprano wrote:
>> If you can do `print e.info()`, then you can also do `info = e.info()`
>> and inspect the info programmatically.
>>
> One would expect that to be true. But when I do info = e.info(), info is
> .
>
> Wh
On 10/13/2012 07:50 PM, Steven D'Aprano wrote:
> On 14/10/12 12:45, Ray Jones wrote:
>> On 10/13/2012 05:09 PM, Brian van den Broek wrote:
>>> On 13 October 2012 19:44, Ray Jones wrote:
I am attempting to capture url headers and have my script make
decisions
based on the content of
On 14/10/12 12:45, Ray Jones wrote:
On 10/13/2012 05:09 PM, Brian van den Broek wrote:
On 13 October 2012 19:44, Ray Jones wrote:
I am attempting to capture url headers and have my script make decisions
based on the content of those headers.
Here is what I am using in the relative portion of
On 10/13/2012 05:09 PM, Brian van den Broek wrote:
> On 13 October 2012 19:44, Ray Jones wrote:
>> I am attempting to capture url headers and have my script make decisions
>> based on the content of those headers.
>>
>> Here is what I am using in the relative portion of my script:
>>
>> try:
>>
On 13 October 2012 19:44, Ray Jones wrote:
> I am attempting to capture url headers and have my script make decisions
> based on the content of those headers.
>
> Here is what I am using in the relative portion of my script:
>
> try:
> urllib2.urlopen('http://myurl.org')
> except urllib2.HTTPE
I am attempting to capture url headers and have my script make decisions
based on the content of those headers.
Here is what I am using in the relative portion of my script:
try:
urllib2.urlopen('http://myurl.org')
except urllib2.HTTPError, e:
In the case of authentication error, I can print
On Fri, Sep 7, 2012 at 11:32 AM, Dave Angel wrote:
>
> I'm curious why the docstring says... timeout =
> but have no clues for you.
socket._GLOBAL_DEFAULT_TIMEOUT is an object(). In other words, it's an
"object object". Also, that's not from the docstring but the call
signature. The functio
On 09/07/2012 08:32 AM, Dave Angel wrote:
> On 09/07/2012 11:16 AM, Ray Jones wrote:
>> 2.7.3
>> According to the docs, urlopen has a timeout capability. But it says
>> that the timeout = ''
>>
>> I've tried integers as the timeout value, I've tried floatsit
>> doesn't complain about my values,
On 09/07/2012 08:33 AM, Steven D'Aprano wrote:
> On 08/09/12 01:16, Ray Jones wrote:
>> 2.7.3
>> According to the docs, urlopen has a timeout capability. But it says
>> that the timeout = ''
>
> Which docs are those? According to these docs:
>
> http://docs.python.org/library/urllib2.html
>
> "The
On 08/09/12 01:16, Ray Jones wrote:
2.7.3
According to the docs, urlopen has a timeout capability. But it says
that the timeout = ''
Which docs are those? According to these docs:
http://docs.python.org/library/urllib2.html
"The optional timeout parameter specifies a timeout in seconds for
bl
On 09/07/2012 11:16 AM, Ray Jones wrote:
> 2.7.3
> According to the docs, urlopen has a timeout capability. But it says
> that the timeout = ''
>
> I've tried integers as the timeout value, I've tried floatsit
> doesn't complain about my values, but neither does it timeout. Can
> anyone point m
2.7.3
According to the docs, urlopen has a timeout capability. But it says
that the timeout = ''
I've tried integers as the timeout value, I've tried floatsit
doesn't complain about my values, but neither does it timeout. Can
anyone point me to the solution to getting the urlopen to timeout if
Hi Martin,
print 'status:', response.status
> print 'reason:', response.reason
> print 'document:', response.read()
>
This is definitly what i was looking for and did not know in which module to
look.
Thank you so much for the code illusration.
Monika.
2008/4/20, Martin Walsh <[EMAIL PROTECTED
Monika Jisswel wrote:
> Hi,
>
> can i stop urllib2.urlopen() from following redirects automatically ?
It doesn't answer your question directly, but if you care more about the
initial request/response than the content at the other end of a redirect
-- you can use httplib. It might look something
Hi,
can i stop urllib2.urlopen() from following redirects automatically ?
one more question i had in mind, the function urllib2.urlopen.geturl() does
get me what i want but does it do the download of the page i was redirected
to ? or just downloads the initial page that actually does the redir
19 matches
Mail list logo