[Tutor] new to python

Alan Gauld alan.gauld at btinternet.com
Fri Nov 19 01:54:06 CET 2010

"Joel Schwartz" <joel at joelschwartz.com> wrote

> packages interact with each other, can you say more about what "COM 
> object
> model" means in this context and where one can learn how to use it 
> to make
> Python interact with Excel and with Windows software in general.

COM = Common Object Model

It is a Microsoft standard to expose application Objects so that 
can interact with each other by calling those objects methods. Because
it is a binary standard it will work with any programming language 
a COM binding.

Typically an office application will expose a Document object that you
can open, read, close etc.Excel includes operations to select tabs,
columns, rows, cells etc.

There have been numerous incarnations of COM over the years, you may
have also heard of OLE, ActiveX, DCOM, COM+ etc.

There is a load of info on the Microsoft Developers web site.
You can access COM via the Pythonwin library in the windows extensions
package and Marrk Hammond's book  Python Programming on Win32
provides extensive descriptions.

Personally I prefer to interact with COM via VBScript as the Python 
is (only slightly) more clunky. IMHO


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list