When I do, in python code,
os.system("mpstat 1 10 | grep Average")
I get, at stdout:
"Average: all 0.00 0.00 0.00 0.00" and a bunch of other things
What can I add to
mpstat 1 10 | grep Average | SOMETHING
to get a variable that contains the line that starts with Average?
I need the sum of the first number and the second number.
I tried the accepted answer here:
Can I redirect the stdout in python into some sort of string buffer?
But it doesn't work.