Getting processor information in Python

后端 未结 10 1998
一向
一向 2020-11-29 04:20

Using Python is there any way to find out the processor information... (I need the name)

I need the name of the processor that the interpreter is running on. I check

10条回答
  •  日久生厌
    2020-11-29 05:21

    The if-cases for Windows i.e platform.processor() just gives the description or family name of the processor e.g. Intel64 Family 6 Model 60 Stepping 3.

    I used:

      if platform.system() == "Windows":
            family = platform.processor()
            name = subprocess.check_output(["wmic","cpu","get", "name"]).strip().split("\n")[1]
            return ' '.join([name, family])
    

    to get the actual cpu model which is the the same output as the if-blocks for Darwin and Linux, e.g. Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz Intel64 Family 6 Model 60 Stepping 3, GenuineIntel

提交回复
热议问题