470,614 Members | 1,481 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

a name error

Hello,

I run this small script:

import urllib2,sys
try:
r=urllib2.urlopen("http://un-know-n.com/")
except URLError,e:
print str(e)
sys.exit(1)

print r.info()
But got the errors:

Traceback (most recent call last):
File "t1.py", line 4, in ?
except URLError,e:
NameError: name 'URLError' is not defined
Why these is not the name of URLError? I saw it on this module's page:

http://www.python.org/doc/lib/module-urllib2.html

Thanks.

Jun 27 '08 #1
0 822

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by shayvillere | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.