From 4298f3e0d6470d52a139f0c08108b5a109cada12 Mon Sep 17 00:00:00 2001 From: Daxeel Soni Date: Tue, 22 Mar 2016 20:18:17 +0530 Subject: [PATCH] Create check_internet_con.py --- check_internet_con.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 check_internet_con.py diff --git a/check_internet_con.py b/check_internet_con.py new file mode 100644 index 00000000000..9f1febbc7f0 --- /dev/null +++ b/check_internet_con.py @@ -0,0 +1,7 @@ +import urllib2 + +try: + urllib2.urlopen("http://google.com/", timeout=2) + print "working connection" +except urllib2.URLError: + print "No internet connection"