【问题标题】:Getting error when working with使用时出错
【发布时间】:2013-07-14 11:44:14
【问题描述】:

我正在尝试在 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)

【问题讨论】:

标签: python-3.x wmi


【解决方案1】:

通过下载解决了问题

适用于 Windows 的 Python 扩展

来自sourceforge 并继续使用 Python x64

谢谢大家

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-11
    • 2018-07-09
    • 2017-09-21
    • 2013-04-07
    • 2016-08-29
    • 2018-07-03
    相关资源
    最近更新 更多