[python-win32] WMI module - Properties Order

pierre baral pierre.baral at gmail.com
Thu Jan 5 02:20:52 CET 2012


Thanks a lot Tim,

I also thought about that hack! :)
I could also parse the wql to put params in a list.

(It would also have be nice to have a list of not ordered properties (after
the wql parsing).
Something like props = [getattr(obj, p) for p in obj.notordered_properties]
:-P)

    c = wmi.WMI()
>     flds = ('Name','Caption','Description')
>     wql = 'Select ' + ','.join(flds) + ' From win32_blabla'
>     objs = (flds,c.query(wql))
>     ...
>     for obj in objs[1]:
>         props = [getattr(obj,p) for p in objs[0]]
>         print  ';'.join(props)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120105/37b438c5/attachment.html>


More information about the python-win32 mailing list