Heads up! This post was written 12 years ago. Some information might be outdated or may have changed since then.
Идеята: Да вземем CPU Load-а към дадения момент под Windows използвайки wmic и python
p = subprocess.Popen("wmic cpu get loadpercentage", stdout=subprocess.PIPE)
text = p.stdout.read()
p.wait()
regex = re.compile("[0-9]+", re.IGNORECASE | re.MULTILINE)
r = regex.findall(text)
print r
Повече информация за WMIC - тук

Back to all posts