8 fp
= open('/proc/stat', 'r')
16 if line
.startswith('cpu'):
17 figures
= line
.split()
19 figures
= map((lambda x
: long(x
)), figures
[1:])
20 busy
= figures
[0] + figures
[1] + figures
[2]
24 busy
+= figures
[5] + figures
[6]
30 cpu
= int(cpu
[3:]) + 1
38 print busy
[cpu
], ':', idle
[cpu
] + busy
[cpu
], ' = ', \
39 100 * busy
[cpu
] / (busy
[cpu
] + idle
[cpu
]), '%'