[python-win32] Using win32com Constants

David Carter dactex at swbell.net
Sat Feb 18 20:01:01 CET 2006

Thanks to all who have sent some assistance...

What I'm trying to accomplish is to understand more of the nuts and bolts.
I'm at the intermediates level of learning python on my own, so there are
bound to be some gaps in my understanding of python's innner workings. 

The constants become available after Dispatch-ing the application whose type
library you want to access.

So yesterday's expression:


is really the same as


And I think this is because win32com.client.constants.__dicts__[0] is a
attribute:value hash for the win32com.client.Constant object
win32com.client.constants, which includes -all- the attributes of the object
as well as the constant/value pairs I was after.

So I can access them then as an attribute of win32com.client.constants if I
know their names.

David Carter

More information about the Python-win32 mailing list