Created
March 12, 2014 15:02
-
-
Save spellancer/9508746 to your computer and use it in GitHub Desktop.
connection_test
This file contains hidden or 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 | |
| def internet_on(): | |
| try: | |
| response=urllib2.urlopen('http://74.125.228.100',timeout=1) | |
| return True | |
| except urllib2.URLError as err: pass | |
| return False | |
| print internet_on() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment