Re: Counting processors

2005-07-26 Thread Mike Meyer
"k pur" <[EMAIL PROTECTED]> writes: > You can use > > print os.sysconf("SC_NPROCESSORS_CONF") > > works on Linux Works on FreeBSD as well. It hooks up to the sysconf C call. That's a Posix call, so this should work portably across Posix systems. I know Windows can be made Posix compliant, but I'm

Re: Counting processors

2005-07-26 Thread MrJean1
Or maybe os.sysconf('SC_NPROCESSORS_ONLN') Usually, the value returned by os.sysconf('SC_NPROCESSORS_ONLN') and os.sysconf('SC_NPROCESSORS_CONF') are the same, but if they do differ, os.sysconf('SC_NPROCESSORS_ONLN') is the reliably figure. /Jean Brouwers PS) This applies to Linux and Solari

RE: Counting processors

2005-07-26 Thread Tim Golden
[k pur] | You can use | | print os.sysconf("SC_NPROCESSORS_CONF") | | works on Linux | | | krishan | | | Pauldoo wrote: | > Hi, | > Is a way in python to obtain the total number of processors | present in | > the system? | > | > os.platform doesn't seem to contain anything useful. And on W

Re: Counting processors

2005-07-26 Thread k pur
You can use print os.sysconf("SC_NPROCESSORS_CONF") works on Linux krishan Pauldoo wrote: > Hi, > Is a way in python to obtain the total number of processors present in > the system? > > os.platform doesn't seem to contain anything useful. -- http://mail.python.org/mailman/listinfo/python-

Re: Counting processors

2005-07-25 Thread Alan Kennedy
[Pauldoo] > Is a way in python to obtain the total number of processors present in > the system? On windows, List Processor Information. Description: Returns information about the processors installed on a computer. http://www.microsoft.com/technet/scriptcenter/scripts/Python/hardware/basic/hwb

Re: Counting processors

2005-07-25 Thread Pauldoo
Yeh well I know of /proc/cpuinfo (due to linux's hacked up non-unix /proc, *grumble*) and the NUMBER_OF_PROCESSORS environment variable on windows. I was just hoping for a slightly more platform independant way of doing it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting processors

2005-07-25 Thread Benji York
Pauldoo wrote: > Is a way in python to obtain the total number of processors present in > the system? I don't know of a platform independent way. If you specify one or more platforms, I'm sure someone will be able to help. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting processors

2005-07-25 Thread [EMAIL PROTECTED]
I don't think there is direct method. On Linux you can inspect file /proc/cpuinfo to determine the installed cpus. -- http://mail.python.org/mailman/listinfo/python-list