[python-win32] Can win32com handle this one?

David Abrahams dave at boost-consulting.com
Thu Feb 7 16:32:54 CET 2008


on Thu Feb 07 2008, Tim Golden <mail-AT-timgolden.me.uk> wrote:

> David Abrahams wrote:
>> Is there somewhere a summary of criteria by which I'd choose win32com or
>> comtypes?
>
> Not that I know of. I offer a so-obvious-as-to-be-almost-unneeded
> list here. It's entirely likely that I've misrepresented things
> somewhat so I'd be very grateful for additions & editions.

Thanks, this should be very helpful.  Please see questions below.

> ==================
> pywin32 (win32com)
> ==================
>
> PRO: Been around for years so more mature, more stable and
> more (knowledgeable) users.
>
> PRO: For those interfaces which it *does* wrap, does most or
> all of the dirty work for you.
>
> PRO: Actively maintained
>
> CON / PRO: Makes things so easy for the novice programmer 

...or the expert short on COM fu and time -- that's me...

> that they forgo any attempt to learn how COM really works... which
> means that when it gets messy they don't really know what's going on.
>
> CON: Has dark and little known/tried corners; I think I discover
> one new win32com feature every month either through this list or
> from reading the source to find something else out.
>
> CON: Occasionally shows its age, esp. wrt Unicode, datetime
> and other types whiseh postdate its original conception.
>
> CON: Only wraps those interfaces (including, critically, IDispatch)
> for which its maintainers have time / inclination.
>
>
> ========
> comtypes
> ========
>
> PRO: Effectively native Python -- relies on ctypes which is
> a C extension but now part of stdlib.
>
> PRO: Actively maintained

That's a biggie.

> PRO: Can, in principle, wrap any interface.
>
> PRO: Newer / smaller so fewer dark corners and refactor-candidates.

Also that.

> PRO/CON: You have to understand more about the way the COM
> works -- as above this has positive and negative points.

Hmm, what I've tried to do so far (admittedly not much) didn't seem to
expose any COM details.  So, like what?

> CON: Newer, so less tried-and-tested: fewer (experienced) users.
>
> CON: You have to do the dirty work yourself; as with ctypes, more
> scope for crashing Python nastily.

Really?  Again, what I saw looked like a pretty clean abstraction layer.

-- 
Dave Abrahams
Boost Consulting
http://boost-consulting.com



More information about the python-win32 mailing list