Cross platform way of finding number of processors on a machine?

Tim Golden mail at timgolden.me.uk
Fri Oct 5 04:42:41 EDT 2007


[Tim Golden]
>>    """
>>    Windows Server 2003, Windows XP, and Windows 2000:
>>      This property is not available.
>>    """
>>
>> since it's presumably not available in anything earlier either,
>> that leaves you with Vista or the early-adopter editions of the
>> next Windows Server product.

Kay Schluehr wrote:

> Remarkable. I've a two years old Windows XP dual core notebook and
> when I'm asking Python I get the correct answer:
> 
>>>> import os
>>>> os.environ['NUMBER_OF_PROCESSORS']
> 2
> 
> However this feature might not be guaranteed by Microsoft for
> arbitrary computers using their OS?

Ahem. I was referring (and not very clearly, now I look
back at my post) to a particular property within the
WMI class, not to the general concept of counting
processors.

TJG



More information about the Python-list mailing list