def my_cmd(self, query, flag):
rst = commands.getoutput(query)
print query
rst = ''.join(rst)
rst = rst.split('\r')[-1]
po = rst.split('\n')[:-1]
# print po
# print '\n\nsystem output 1 = \n' + rst
# print po
# print 'neighbours1', neighbours1
if flag:
def p (x): return [x.split(' ')[1], x.split(' ')[2]]
else :
def p (x): return [x.split(' ')[1], x.split(' ')[0]]
result = map(p, po)
# print 'result = '
# print result
return result
评论列表
文章目录