Re: How can I check nbr of cores of computer?

2008-07-31 Thread Duncan Booth
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I don't expect that Python will have a built-in core-counting function. > You would probably need to ask the operating system. On Linux, you could > do this: > > import os > text = os.popen('cat /proc/cpuinfo').read() > > > How you would do it in W

Re: How can I check nbr of cores of computer?

2008-07-30 Thread Steven D'Aprano
On Wed, 30 Jul 2008 11:22:12 -0700, John Nagle wrote: > defn noob wrote: >> How can I check how many cores my computer has? Is it possible to do >> this in a Python-app? > > Why do you care? Python can't use more than one of them at > a time anyway. Why do you care why he cares? And he did

Re: How can I check nbr of cores of computer?

2008-07-30 Thread Daniel da Silva
Single line using /proc/cpuinfo: numprocs = [ int(line.strip()[-1]) for line in open('/proc/cpuinfo', 'r') if \ line.startswith('processor') ][-1] + 1 On Wed, Jul 30, 2008 at 2:16 PM, Dan Upton <[EMAIL PROTECTED]> wrote: > > On Wed, Jul 30, 2008 at 2:22 PM, John Nagle <[EMAIL PROTE

Re: How can I check nbr of cores of computer?

2008-07-30 Thread Leonhard Vogt
defn noob schrieb: How can I check how many cores my computer has? Is it possible to do this in a Python-app? processing (http://pyprocessing.berlios.de/) has an utility function processing.cpuCount(). Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I check nbr of cores of computer?

2008-07-30 Thread Dan Upton
On Wed, Jul 30, 2008 at 2:22 PM, John Nagle <[EMAIL PROTECTED]> wrote: > defn noob wrote: >> >> How can I check how many cores my computer has? >> Is it possible to do this in a Python-app? > >Why do you care? Python can't use more than one of them at > a time anyway. Per Python process, but

Re: How can I check nbr of cores of computer?

2008-07-30 Thread John Nagle
defn noob wrote: How can I check how many cores my computer has? Is it possible to do this in a Python-app? Why do you care? Python can't use more than one of them at a time anyway. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I check nbr of cores of computer?

2008-07-29 Thread [EMAIL PROTECTED]
On Jul 29, 7:44 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jul 29, 5:53 pm, defn noob <[EMAIL PROTECTED]> wrote: > > > How can I check how many cores my computer has? > > Is it possible to do this in a Python-app? > > If you're using Windows, get PyWin32: > > win32api.GetSystemInfo > tuple = Ge

Re: How can I check nbr of cores of computer?

2008-07-29 Thread Mensanator
On Jul 29, 5:53 pm, defn noob <[EMAIL PROTECTED]> wrote: > How can I check how many cores my computer has? > Is it possible to do this in a Python-app? If you're using Windows, get PyWin32: win32api.GetSystemInfo tuple = GetSystemInfo() Retrieves information about the current system. Win32 API

Re: How can I check nbr of cores of computer?

2008-07-29 Thread gbs
On Tue, 29 Jul 2008 15:53:47 -0700, defn noob wrote: > How can I check how many cores my computer has? Is it possible to do > this in a Python-app? Well you can try the functions in the 'platform' module, although in my box(debian) nothing useful comes out. I don't think there's a simple & port

Re: How can I check nbr of cores of computer?

2008-07-29 Thread Casey McGinty
On Tue, Jul 29, 2008 at 12:53 PM, defn noob <[EMAIL PROTECTED]> wrote: > How can I check how many cores my computer has? > Is it possible to do this in a Python-app? > -- > http://mail.python.org/mailman/listinfo/python-list > You can use the HAL interface from the DBUS module. See also the gnome

How can I check nbr of cores of computer?

2008-07-29 Thread defn noob
How can I check how many cores my computer has? Is it possible to do this in a Python-app? -- http://mail.python.org/mailman/listinfo/python-list