Created
February 22, 2012 18:11
-
-
Save pushmon/1886414 to your computer and use it in GitHub Desktop.
Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
urlString = 'http://pshmn.com/eaFnY' | |
try: | |
handle = urllib2.urlopen(urlString) | |
handle.read() | |
handle.close() | |
except IOError: | |
print "log error" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably time to make this Python3 compatible :) You'll need to change line 9 to
print("log error")
and not useurllib2
. Cheers.