2010-06-16 2 views

답변

0

그 이름을 가진 두 개의 프로젝트가있는 것 같습니다. 둘 다 시도 했니? Bram de Greve

+0

둘 다 py 2.6에서 작동하지 못했습니다. arun.sharma의 모든 예제 cpuid는 0을 반환합니다. – Derek

1

당신은 WMI에서 CPU ID를 얻을 수 있습니다. VBScript Sample here 파이썬에서 WMI을 사용할 수 있습니다.
이 두 리소스를 결합하여 나머지를 파악할 수 있다고 생각합니다.

5

wmi을 사용해 보셨습니까?

Here's a solution

는 :

>>> import wmi 
>>> c = wmi.WMI() 
>>> for s in c.Win32_Processor(): 
    print s 



instance of Win32_Processor 
{ 
    AddressWidth = 64; 
    Architecture = 9; 
    Availability = 3; 
    Caption = "Intel64 Family 6 Model 26 Stepping 5"; 
    CpuStatus = 1; 
    CreationClassName = "Win32_Processor"; 
    CurrentClockSpeed = 3068; 
    DataWidth = 64; 
    Description = "Intel64 Family 6 Model 26 Stepping 5"; 
    DeviceID = "CPU0"; 
    ExtClock = 133; 
    Family = 1; 
    L2CacheSize = 1024; 
    L3CacheSize = 8192; 
    L3CacheSpeed = 0; 
    Level = 6; 
    LoadPercentage = 3; 
    Manufacturer = "GenuineIntel"; 
    MaxClockSpeed = 3068; 
    Name = "Intel(R) Core(TM) i7 CPU   950 @ 3.07GHz"; 
    NumberOfCores = 4; 
    NumberOfLogicalProcessors = 8; 
    PowerManagementSupported = FALSE; 
    ProcessorId = "BFEBFBFF000106A5"; 
    ProcessorType = 3; 
    Revision = 6661; 
    Role = "CPU"; 
    SocketDesignation = "CPU 1"; 
    Status = "OK"; 
    StatusInfo = 3; 
    SystemCreationClassName = "Win32_ComputerSystem"; 
    SystemName = "RYAN-PC"; 
    UpgradeMethod = 1; 
    Version = ""; 
    VoltageCaps = 0; 
}; 
2

나는 wmic 명령은 Windows-XP에서 항상 사용할 수 있음을 발견하고, 그것을 실행하기보다는 특별한 파이썬 패키지를 설치하기 위해 내 사용자가 요구하는 subprocess.Popen를 사용했습니다.

C:\>wmic cpu get ProcessorId /format:csv 

Node,ProcessorId 
E100325,BFEBFBFF00000F43 
E100325,BFEBFBFF00000F43 
+0

다른 써드 파티 패키지를 설치할 필요가 없습니다. Win-8.1도 작동합니다. – jtuki

관련 문제