Getting processor information in Python

后端 未结 10 1967
一向
一向 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:02

    I tried out various solutions here. cat /proc/cpuinf gives a huge amount of output for a multicore machine, many pages long, platform.processor() seems to give you very little. Using Linux and Python 3, the following returns quite a useful summary of about twenty lines:

    import subprocess
    print((subprocess.check_output("lscpu", shell=True).strip()).decode())
    

提交回复
热议问题