Skip to content

Commit ec74f40

Browse files
authored
Internet Connection Checker for Py3
1 parent 45a51c0 commit ec74f40

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internet_connection_py3

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import urllib.request
2+
3+
try:
4+
urllib.request.urlopen('http://google.com')
5+
print ("working connection")
6+
7+
except urllib.error.URLError:
8+
print ("No internet connection")

0 commit comments

Comments
 (0)