可以是任何不同,以获得下一个命令之间的输出:
lsof_list = commands.getoutput('lsof | awk \'{print $1,$2,$5}\')
要么:
lsof_list1 = commands.getoutput('lsof | awk \'{print $1}\')
lsof_list2 = commands.getoutput('lsof | awk \'{print $2}\')
lsof_list5 = commands.getoutput('lsof | awk \'{print $5}\')
lsof_list = [lsof_list1, lsof_list2, lsof_list5]
当然,行会是列,反之亦然,但我怀疑主要是关于数据,可可能会有在代码工作时间不同数量的打开文件?
可以肯定,有没有在同一时间执行Python中的几条命令的任何功能?