#!/usr/bin/python
import os
import threading
a=file("/home/ip.txt","r")
print a
b=a.read()
print b
c=b.split()
def ping1(i):
return1=os.system(‘ping -c 2 %s‘%i)
if return1:
print ‘%s‘ %k
elif return1 == "False":
print bad
k="good"
if __name__==‘__main__‘:
for i in c:
print i
aa=threading.Thread(target=ping1,args=(i,))
aa.start()
本文出自 “expect批量同步数据” 博客,请务必保留此出处http://4249964.blog.51cto.com/4239964/1365175