来自<<python核心编程第三版>>
源代码是python2,已经改成python3.
import os
import re
f = os.popen('tasklist /nh', 'r')
for eachLine in f:
print (re.findall(
r'([\w.]+(?: [\w.]+)*)\s\s+(\d+) \w+\s\s+\d+\s\s+([\d,]+ K)',
eachLine.rstrip()))
f.close()