Re: a name error

2008-04-15 Thread mimi.vx
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

Re: a name error

2008-04-14 Thread Gabriel Genellina
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): >

Re: a name error

2008-04-14 Thread Paul Scott
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

a name error

2008-04-14 Thread Penny Y.
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