473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to find number of processors in python

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
Jul 18 '05 #1
2 2341
>>>>> "muttu" == muttu <mu*******@yaho o.com> 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
Jul 18 '05 #2
"/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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
779
by: AA | last post by:
Do you know how can i get that? Thanks a lot
5
6865
by: PaulThomas | last post by:
Using VS.Net 2000 and C# How can I get the CPU Serial Number and the Operating Syatem Serial Number Thanks in advance, Paul
2
1999
by: mairhtin o'feannag | last post by:
Hello, I am a bit confused as to how this all works with respect to number of processors on a Linux machine. The situation I am encountering is this : because of Hyperthreading technology, the OS thinks it has four processors, but in reality, it has only two. I have updated the db2licm to use two processors, but want to be certain I did...
7
2118
by: Jean-David Beyer | last post by:
I have six hard drives (4 SCSI and 2 EIDE) on my main machine with parts of a database on each drive. The main index is on one SCSI drive all to itself. The main data are on the other three SCSI drives. Small relations are on one EIDE drive, and the logfiles are on the other EIDE drive. When running the task, below, the rest of the machine is...
1
9602
by: Dominic | last post by:
I'd like to tune the performance of my application in a web garden. Our server has dual processors. Is there any guideline to set this "maximum number of worker processes" for web garden? In my application, stress test shows that setting it to 2 gives a better performance result. In other words, web garden helps. My first question is if it...
109
7560
by: jmcgill | last post by:
Hello. Is there a method for computing the number of digits, in a given numeric base, of N factorial, without actually computing the factorial? For example, 8! has 5 digits in base 10; 10! has 7 digits in base 10. Is there a way to compute that information without actually evaluating the factorial?
11
4905
by: John | last post by:
Is there a way to find the number of processors on a machine (on linux/ windows/macos/cygwin) using python code (using the same code/cross platform code)?
1
1400
by: zeero | last post by:
Hi, i want to get the number processors in my machine. Plz guide. The code is running on a core 2 duo machine have 2 processing cores so I expect to get 2 processors. I'm writing code in native visual c++ 2005. Regards, ..z
2
1980
by: Shao | last post by:
Dear All, I am looking for a nitty-gritty Python Ajax script to fire off a number of processing programmes, periodically checking their operations, sending messages back to an HTML div form by sending back the links of generated data files, to be downloaded by end users. I am using .NET IIS 6.0 and Windows Server. Regards.
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.