how to find number of processors in python

M

muttu

hello everybody
am writing a scanner using python which has to get the information for
sun's dual processors, so could any one of you please tell me how to
find the number of processors . is there any api's for this , and also
lemme know how exactly i can write the scannerapi for this, so that it
can read the information of all the cpu's. I have the related CFG
file for that.
with regards
thanks in advance
 
G

Ganesan R

muttu" == muttu said:
hello everybody
am writing a scanner using python which has to get the information for
sun's dual processors, so could any one of you please tell me how to
find the number of processors . is there any api's for this

You can run /usr/sbin/psrinfo with os.system() and parse the output.

Ganesan
 
C

Christopher De Vries

"/usr/sbin/psrinfo -p" will print the number of physical processors on the
system, though it does not indocate if they are on- or off-line. You could also
write an extension which gets processor information using the sys/processor
library. Example code is available in the "p_online" man page.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top