Python判断网络是否正常的脚本
作者:互联网
python判断计算机是否有网络连接的实例_python_脚本之家 https://www.jb51.net/article/152829.htm
def isConnected(): import requests try: html = requests.get("http://www.baidu.com",timeout=2) print("网络正常") return 1 except: print("网络异常") return 0 Flag = isConnected() print(Flag)
标签:脚本,www,return,Python,网络,isConnected,python,Flag,print 来源: https://www.cnblogs.com/xdd1997/p/15226740.html