#coding=utf-8 import os command = 'ping www.baidu.com ' #可以直接在命令行中执行的命令 r = os.popen(command) #执行该命令 info = r.readlines() #读取命令行的输出到一个list for line in info: #按行遍历 line = line.strip('\r\n') print line ----------------------------------…
https://www.cnblogs.com/captain_jack/archive/2011/01/11/1933366.html zzz.py import sys from optparse import OptionParser filelist = ["/home/an/a","/home/an/b"] def main(filelist,tmpfile=None): for filename in filelist: with open(filena…