or
import sys
from urllib2 import *
try:
r=urllib2.urlopen("http://un-know-n.com/";)
except URLError,e:
print str(e)
sys.exit(1)
print r.info()
se python scope and namespaces ..
--
http://mail.python.org/mailman/listinfo/python-list
En Tue, 15 Apr 2008 02:54:43 -0300, Penny Y. <[EMAIL PROTECTED]> escribió:
> 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):
>
On Tue, 2008-04-15 at 13:54 +0800, Penny Y. wrote:
> 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
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