对python判断ip是否可达的实例详解

上传:qq_57611 浏览: 19 推荐: 0 文件:PDF 大小:32.77KB 上传时间:2020-12-31 16:49:42 版权申诉
python中使用subprocess来使用shell 关于threading的用法 from __future__ import print_function import subprocess import threading def is_reachable(ip): if subprocess.call([ping, -c, 2, ip])==0:#只发送两个ECHO_REQUEST包 print({0} is alive..format(ip)) else: print({0} is unalive.format(ip)) if __na
上传资源
用户评论