import urllib
try:
return urllib.urlopen(source)
except (IOError, OSError):
pass
try:
return urllib.urlopen(source)
except (IOError, OSError):
pass
Example borrowed from the always excellent Dive Into Python.
Python, MySQL and Your Mom
No comments:
Post a Comment