📅  最后修改于: 2022-03-11 14:47:25.287000             🧑  作者: Mango
import urllib2
def internet_on():
try:
urllib2.urlopen('http://216.58.192.142', timeout=1)
return True
except urllib2.URLError as err:
return False