On 04/03/2010 06:38, pyt...@bdurham.com wrote:
Is there a way to enumerate a WMI object's properties to discover
what they are vs. having to explictly reference properties by
name?

Assuming I understand the question, a quickie shortcut is
just to "print" the object:

<code>
import wmi

c = wmi.WMI ()
for s in c.Win32_ComputerSystem ():
  print s

</code>

but in fact each object also holds a list of its own properties:

<code>
import wmi

c = wmi.WMI ()
print list (c.Win32_ComputerSystem.properties)
print list (c.Win32_ComputerSystem.methods)

or you can do the same with an instance:

for s in c.Win32_ComputerSystem ():
  print list (s.properties)

</code>

TJG
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to