Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get attributes of query result? #51

Open
federicoemartinez opened this issue Jan 13, 2024 · 0 comments
Open

Get attributes of query result? #51

federicoemartinez opened this issue Jan 13, 2024 · 0 comments

Comments

@federicoemartinez
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant