Better utilization of duo-core?
Fredrik Lundh
fredrik at pythonware.com
Thu Jul 13 15:54:13 EDT 2006
Fredrik Lundh wrote:
>> How do I detect whether I have additional CPUs in the system? The
>> google search turns up answer about a Sun workstation but not Windows
>> XP.
>
> count = int(os.environ.get("NUMBER_OF_PROCESSORS", 1))
footnote: a more "correct" way to do this is to use WMI. links:
http://timgolden.me.uk/python/wmi.html
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/wmi_tasks__computer_hardware.asp
(look for "determine if a computer has more than one processor"
</F>
More information about the Python-list
mailing list