How to prevent the script from stopping before it should

wittempj at hotmail.com wittempj at hotmail.com
Mon Jan 17 18:19:47 CET 2005


#import urllib, sys
#pages = ['http://www.python.org', 'http://xxx']
#for i in pages:
#   try:
#        u = urllib.urlopen(i)
#        print u.geturl()
#    except Exception, e:
#        print >> sys.stderr, '%s: %s' % (e.__class__.__name__, e)
will print an error if a page fails opening, rest opens fine




More information about the Python-list mailing list