views:

36

answers:

1

In the WMI module (yeah, my boss wants me to program in Windows — but at least it’s not in COBOL), it seems that you can access a WMI value either by passing it’s name as a string parameter of a method,

blabla=wmithingy().getvalue('nameOfValue')

or as a property/method:

blabla=wmithingy().nameOfValue()

Am I dreaming, smoking bad weed, or can it effectively be done (and how)?

+1  A: 

Either the getvalue() method uses getattr(), or the __getattr__() method defers to the getvalue() method.

Ignacio Vazquez-Abrams