我正在尝试在Python 3.32 64Bit windows 7下运行代码,我不断收到以下错误 任何想法或建议如何使用WMI,我尝试从pypy WMI,但它与相同的错误相关 请指教 感谢
ImportError:没有名为'win32com'的模块
from win32com.client import GetObject
WMI = GetObject('winmgmts:')
#List all processes
processes = WMI.InstancesOf('Win32_Process')
for process in processes:
print (process.Properties_('Name'))
#Get a specific process
p = WMI.ExecQuery('select * from Win32_Process where Name="chrome.exe"')
#view all possible properties
for prop in p[0].Properties_:
print (prop)
#print out PID
print (p[0].Properties_('ProcessId').Value)