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 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/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
__
Thank you xDog and Steven. The whole assignment makes a lot of sense now
after your explanations of what hasattr is doing. Thanks
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinf
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
Hello people,
Firstly, thank you so much for all the assistance you provide so
selflessly through this medium.
I come from a functional programming background and have only recently
become serious with OOP.
For practice, I tried to implement John Conways 'Game of Life' without
a GUI and ran into so
On 14/10/12 23:34, Osemeka Osuagwu wrote:
In the code below, I can't seem to get around calling an instance
method (__reality_check()) from within a class method (update_grid()),
Of course you can't :)
Since the class method has no access to the instance, it cannot call
instance methods, sinc
On 14/10/12 13:34, Osemeka Osuagwu wrote:
I understand instance, static and class methods but I'm still
struggling with when and where they should be used.
You can pretty much ignore static methods, they were almost an
historic 'accident' superseded, in most cases, by class methods. The
numbe
hello, i have this code:
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import re
import urllib2
import BeautifulSoup
origin_site =
'http://DOMAIN.TLD/index.php?id=annuaire_assos&theme=0&rech=&num_page='
pages = range(1,3)
for page_no in pages:
print '== %s' % page_no
re
ignore, i got it:
get_url = re.compile(r"""window.open\('(.*)','','toolbar=0,""",
re.DOTALL).findall
...
get_onclick = str(soup('a')[0]['onclick']) # get the
'onclick' attribute
urls = get_url(get_onclick)
print assoc_name
On 15/10/12 05:05, Norman Khine wrote:
for page_no in pages:
[...]
try:
urllib2.urlopen(req)
except urllib2.URLError, e:
pass
else:
# do something with the page
doc = urllib2.urlopen(req)
This is a bug. J
On 10/14/2012 8:34 AM, Osemeka Osuagwu wrote:
except:
print 'Cannot display Grid'
In addition to Steve's comment I add my own gripe:
When delivering an error message tell us WHY. I have seen too many
messages "cannot do xxx" with no information that mi
Hi thanks, i changed the code to http://pastie.org/5059153
One thing is that when I try to write the assoc_data into a CSV file,
it groaks on
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc7' in position 0:
here some sample data from the print:
[u'Social', u'Action9', u'ash-ni...
Norman Khine schreef op zo 14-10-2012 om 23:10 [+0100]:
> One thing is that when I try to write the assoc_data into a CSV file,
> it groaks on
>
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xc7' in position
> 0:
It looks like python is doing an implicit decode/encode on one of y
i tried this: http://pastie.org/5059153
but now i get a
Traceback (most recent call last):
File "nimes_extract.py", line 75, in
c.writerow([item.encode("UTF-8")])
TypeError: 'NoneType' object is not callable
On Mon, Oct 15, 2012 at 12:12 AM, Sander Sweers wrote:
> Norman Khine schreef
Please don't top post.
> On Mon, Oct 15, 2012 at 12:12 AM, Sander Sweers
> wrote:
> > Norman Khine schreef op zo 14-10-2012 om 23:10 [+0100]:
> >> One thing is that when I try to write the assoc_data into a CSV file,
> >> it groaks on
> >>
> >> UnicodeEncodeError: 'ascii' codec can't encode char
Sander Sweers schreef op ma 15-10-2012 om 02:35 [+0200]:
> > On Mon, Oct 15, 2012 at 12:12 AM, Sander Sweers
> > wrote:
> > > Norman Khine schreef op zo 14-10-2012 om 23:10 [+0100]:
> > Norman Khine schreef op ma 15-10-2012 om 00:17 [+0100]:
> > i tried this: http://pastie.org/5059153
Btw, if I
HELP! Hi I'm a newbie in Python, I'm having trouble organizing the FILE into
the OUTPUT BELOW. I put the file into read, then I put it on a list, and my
plan is to put the name and the corresponding grades into a dictionary, using
the elements on the list, but when I print the dictionary, it's n
On 10/14/2012 9:21 PM, Salinas, Erwin d wrote:
HELP! Hi I'm a newbie in Python,
welcome
A few pointers regarding use of this email list:
- we are a few volunteers who try to help as we can
- please put your responses following the relevant text rather than at
the top
- please reply-all so a c
19 matches
Mail list logo