import subprocess
def runcmd(cmd):
process = subprocess.Popen(cmd , shell = True, stdout=subprocess.PIPE)
return process.stdout.read().strip()
if __name__=="__main__":
file=runcmd("ps -aux")
file_lst=file.split("\n")
vsz=[]
for i in file_lst:
vsz.append(i.split()[4])
print vsz
阅读(320) | 评论(0) | 转发(0) |