0
我想从字符串中获取特定的行列元素。如何从python中的字符串获取特定的行列元素?
import subprocess
process = subprocess.Popen(['free','-m'],stdout=subprocess.PIPE)
out, err = process.communicate()
out = out.decode("utf-8")
print(out)
输出是:
total used free shared buff/cache available
Mem: 3854 2778 299 351 776 407
Swap: 3909 80 3829
我想第三排,3ND列元素,也就是80 我怎样才能得到呢?
分上线,然后分割线,挑3元 –