Skip to content

Get attributes of query result? #51

@federicoemartinez

Description

@federicoemartinez

Hi there!
I'm exploring this library instead of the pywin32 base wmi one.
I do some "dynamic" queries to classes entered by the user, so I don't know in advance the "keys" of the result. In wmi, I have the property "properties" which gives a map of the attributes returned. I couldn't see that in your wmi wrapper. Is there a way to do that?
For exmaple, I can do that with the other WMI library:

>>> import wmi
>>> conn = wmi.WMI()
>>> conn.query("select * from Win32_BaseBoard")[0].properties.keys()

dict_keys(['Caption', 'ConfigOptions', 'CreationClassName', 'Depth', 'Description', 'Height', 'HostingBoard', 'HotSwappable', 'InstallDate', 
'Manufacturer', 'Model', 'Name', 'OtherIdentifyingInfo', 'PartNumber', 'PoweredOn', 'Product', 'Removable', 'Replaceable', 
'RequirementsDescription', 'RequiresDaughterBoard', 'SerialNumber', 'SKU', 'SlotLayout', 'SpecialRequirements', 'Status', 'Tag', 'Version', 
'Weight', 'Width'])

Can I do the same with PyMI?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions