Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check system has internet using python

import urllib.request
def connect():
    try:
        urllib.request.urlopen('http://google.com') #Python 3.x
        return True
    except:
        return False
print( 'connected' if connect() else 'no internet!' )
 
PREVIOUS NEXT
Tagged: #check #system #internet #python
ADD COMMENT
Topic
Name
1+9 =