Python入门教程-超详细1小时学会Python.docxVIP

  • 16
  • 0
  • 约7.53千字
  • 约 18页
  • 2021-08-16 发布于内蒙古
  • 举报

Python入门教程-超详细1小时学会Python.docx

Python入门教程-超详细1小时 学会Python Python入门教程超详细1小时学会Python 为什么使用Python 假设我们有这么一项任务:简单测试局 域网中的电脑是否连通.这些电脑的ip范围从1 92. 168. 0. 101 到 192. 168. 0. 200. 思路:用shell编程.(Linux通常是bas h而Windows是批处理脚本).例如,在Windows 上用ping ip的命令依次测试各个机器并得到 控制台输出.由于Ping通的时候控制台文本通 常是Reply from??.”而不通的时候文本是 time out ,所以,在结果中进行字符串査 找,即可知道该机器是否连通. 实现:Java代码如下: String cBd=*cmd. exe pin^ *; String ipprefix=*192.168.10. *; int begin=101; int end=200; Process p=null: for(int i=begin;iend;i*+)( p= Runtime. tetRuntine()? exec(cnd+i); String line = null; BuffercdReadcr readertreamO)):new BufferedRcadcr (new ] BuffercdReadcr reader treamO)):

文档评论(0)

1亿VIP精品文档

相关文档