[python-win32] WMI module - Properties Order

pierre baral pierre.baral at gmail.com
Thu Jan 5 01:41:01 CET 2012


Hello Tim,

In fact, I would like to generate a code that is generic... without knowing
the name of the properties (so without calling obj.property) !

Check my example:

c = wmi.WMI()
wql = "Select Name, Caption, Description From Win32_Blabla"
objs = c.query(wql)

for obj in objs:
    props = [getattr(obj, p) for p in obj.properties]
    print "%s" % (";" . join ([p for p in props]))

Actually it will print the props list with the obj.properties order (not
the order
of my request)

Any tips to keep the order of my request? So It's not possible? ;'(

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120105/7d4bd189/attachment.html>


More information about the python-win32 mailing list