We briefly discuss here the COM examples written in Python that have been translated from the Ruby examples presented in chapters IV.2 and IV.4. As these examples are already discussed in detail in Part IV and chapter V.1, no detailed explanation is needed here.
The Ruby examples in directories “EX01” to “EX37” have all been translated to Python and use the COM component instead of a Python extension. All the translated examples are very similar to the Python examples in chapter V.1. The differences are related to the COM specificities discussed in chapter VI.0: access to the COM component, creation of class instances, iterators, operators, etc. One small module defining Python-COM specific methods has been added. This module is presented in the file “COM/UTIL/comUtil.py” and defines two methods:
“wrap”, which handles problems with COM return types that are sometimes not well managed by Python.
“dictToComMap”, which deals with COM arrays meant to be used as dictionaries.
Examining the translated examples should help the user understand how these methods are used.
The “PROJECT” example has also been translated to Python with COM and is presented in directory “COM/PROJECT”.