how to find number of processors in python

Discussion in 'Python' started by muttu, Jan 31, 2005.

  1. muttu

    muttu Guest

    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
     
    muttu, Jan 31, 2005
    #1
    1. Advertising

  2. muttu

    Ganesan R Guest

    >>>>> "muttu" == muttu <> writes:

    > 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
     
    Ganesan R, Jan 31, 2005
    #2
    1. Advertising

  3. "/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
     
    Christopher De Vries, Jan 31, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manfred Schwab
    Replies:
    5
    Views:
    1,245
    Chris Liechti
    Nov 6, 2004
  2. Steven
    Replies:
    8
    Views:
    476
    Arndt Jonasson
    Feb 3, 2006
  3. Jekyll
    Replies:
    2
    Views:
    432
    Victor Bazarov
    Apr 24, 2007
  4. John
    Replies:
    11
    Views:
    5,675
    Lawrence Oluyede
    Oct 8, 2007
  5. Shao
    Replies:
    2
    Views:
    336
Loading...

Share This Page