Python wmi c.Win32\u PerfFormattedData\u PerfOS\u处理器win7错误
有人能解释这个追溯吗?在WIN7计算机上进行了远程调用。AttributeError表示对象c没有Win32\u PerfFormattedData\u PerfOS\u Processor属性 表示Python要求c描述自己,而c返回的字符串显然没有太大帮助。看起来您已经创建了c,因此如果您将创建c的代码包括在内,将更能说明问题 我最好的猜测是c是某种WMI包装器,但该WMI对象没有Win32_PerfFormattedData_PerfOS_处理器函数/方法/属性 根本原因是您没有按设计使用c,可能缺少一些运行时组件,或者c没有正确初始化。更新: 这是有效的:即在cmd->lodctr/qPython wmi c.Win32\u PerfFormattedData\u PerfOS\u处理器win7错误,python,windows-7,wmi,Python,Windows 7,Wmi,有人能解释这个追溯吗?在WIN7计算机上进行了远程调用。AttributeError表示对象c没有Win32\u PerfFormattedData\u PerfOS\u Processor属性 表示Python要求c描述自己,而c返回的字符串显然没有太大帮助。看起来您已经创建了c,因此如果您将创建c的代码包括在内,将更能说明问题 我最好的猜测是c是某种WMI包装器,但该WMI对象没有Win32_PerfFormattedData_PerfOS_处理器函数/方法/属性 根本原因是您没有按设计使用
[链接]你说得对。c是WMI包装,即c=WMI.WMI。问题是,我在WinXP机器上获得了相关属性,但在win7机器上没有。有什么意见吗?为什么?后续问题应该作为一个新问题提出。嗯。。这是我最初的问题真的。。正如标题“win7错误”。。thx顺便说一句,这家伙似乎得到了一个相同的错误:
>>> for i in c.Win32_PerfFormattedData_PerfOS_Processor():
... print i
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\work\pythonsv\vendor\wmi.py", line 1029, in __getattr__
return getattr (self._namespace, attribute)
File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 496, in
__getattr__
raise AttributeError, "%s.%s" % (self._username_, attr)
AttributeError: <unknown>.Win32_PerfFormattedData_PerfOS_Processor