7

I'm trying to find out where this value is stored in both windows and osx, in order to do some calculations to make a better task distribution.

Core speed in Hz

Thanks in advance.

Using the platform.process() command only returns the name not the speed

I only managed to get it trough this:

import subprocess  
info=subprocess.check_output(["wmic","cpu","get", "name"])  
print info.split('@')[1].split(' ')[1]

But for the moment i have no way to tell if it will always return the same result in every machine (no access to other computers right now)

NightmaresInd
  • 75
  • 1
  • 1
  • 5
  • If you have a vague idea, share your code or do not ask for these first two points. It is always recommended to show what you have already tried before posting here. – DevLounge Sep 19 '15 at 20:23
  • i did it some years ago, i would have to search trough all my scripts to find where and how – NightmaresInd Sep 19 '15 at 21:50
  • Not a duplicate. The question linked is asking specifically about processor name, not speed. Upvote in defiance. –  Jun 20 '18 at 18:01

1 Answers1

7

Machine ID

There is currently no cross platform python way of getting a Machine ID, however this has been asked before: Get a unique computer ID in Python on windows and linux

if you just want the machine name use platform.node()

Number of cores

The multiprocessing module contains the multiprocessing.cpu_count() method

Cores speed in Hz

There is currently no cross platform python way of getting cpu frequency, however this has been asked before: Getting processor information in Python

Community
  • 1
  • 1
Azsgy
  • 3,139
  • 2
  • 29
  • 40
  • thanks Atsch, yet about the speed, the _platform.processor()_ only returns the name not the speed – NightmaresInd Sep 19 '15 at 21:51
  • @Nightmareslnd yes, indeed. IIRC one of the lower answers shows you how to parse the system information for the frequency though. – Azsgy Sep 19 '15 at 22:04