cpu几核
import psutil
def GetCpuInfo():
cpu_count = psutil.cpu_count(logical=False) #1代表单核CPU,2代表双核CPU
xc_count = psutil.cpu_count() #线程数,如双核四线程
cpu_slv = round((psutil.cpu_percent(1)), 2) # cpu使用率
list = [cpu_count,xc_count,cpu_slv]
return list
print(GetCpuInfo())