[docs] object attribute error

Genco Yilmaz gencoyilmaz at gmail.com
Mon Jul 18 17:55:15 CEST 2011


Hi there,
   I think there is a small mistake at the following url and snippet I
added. the last line
"data = urllib2.open(full_url)"  is giving attribute error, I think it must
be urllib2.urlopen(full_url) right?


thanks a lot


URL:
http://docs.python.org/howto/urllib2.html


ERROR SECTION:

>>> import urllib2>>> import urllib>>> data = {}>>> data['name'] = 'Somebody Here'>>> data['location'] = 'Northampton'>>> data['language'] = 'Python'>>> url_values = urllib.urlencode(data)>>> print url_valuesname=Somebody+Here&language=Python&location=Northampton>>> url = 'http://www.example.com/example.cgi'>>> full_url = url + '?' + url_values>>> data = urllib2.open(full_url)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20110718/2a5443e0/attachment-0001.html>


More information about the docs mailing list