Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python check if internet is available

import urllib.request

def internet_on():
    try:
        urllib.request.urlopen('http://216.58.192.142', timeout=2)
        return True
    except:
        return False
 
PREVIOUS NEXT
Tagged: #python #check #internet
ADD COMMENT
Topic
Name
1+2 =