- xml.dom.minidom中的使用
pretty_print = lambda data: '\n'.join([line for line in xml.dom.minidom.parseString(data).toprettyxml(indent=' '*2).split('\n') if line.strip()])
- list类型的使用
pretty_print = lambda data: ''.join([line for line in data if line.strip()])
my_ssh = My_ssh(ip='x.x.x.x', username='xx', password='xx')
stdin, stdout, stderr  = my_ssh.my_exec_command(" arp -a ")
stdout = stdout.readlines()
print(pretty_print(stdout))
- if l[:-1].strip() 的语法
for i in ret:
      if i[:-1].strip():
            file.write(i+'\t\n')