The comtypes package
comtypes is a pure Python COM package based on the
ctypes ffi
foreign function library. ctypes is included in Python 2.5 and
later, it is also available for Python 2.4 as separate download.
While the pywin32 package contains superior client side support for dispatch based COM interfaces, it is not possible to access custom COM interfaces unless they are wrapped in C++-code.
The comtypes package makes it easy to access and implement both
custom and dispatch based COM interfaces.
Functionalities
Links
Kourovtsev, Yaroslav (2008). “Working with Custom COM Interfaces from Python”
This article describes how to use
comtypesto access a custom COM object.
Chen, Alicia (2012). “Comtypes: How Dropbox learned to stop worrying and love the COM”
This article describes Dropbox’s experience using
comtypesto interact with COM objects in a Windows application.
Downloads
The comtypes project is hosted on GitHub.
Releases can be downloaded from the GitHub releases
section.
Installation
comtypes is available on PyPI and
can be installed with pip:
pip install comtypes