Are makepy-generated COM wrapper classes distributable?

gundlach gundlach at gmail.com
Tue Aug 5 09:54:08 EDT 2008


On Aug 4, 2:24 am, gundlach <gundl... at gmail.com> wrote:
> Can I somehow bundle the generated modules into my
> setuptools package so that the wrappers are installed at the same
> time?  (If so, how -- just copy them into the package directory?)  Or
> are the wrappers targeted to my machine or installation, so that
> everyone is forced to go through this?

I answered my own question, and it's even better than I had hoped
for.  For posterity: running

  python $PYTHONDIR/lib/site-packages/win32com/client/makepy.py -i

and selecting your COM class of choice will output the Python code to
stick into your module which guarantees that the necessary wrapper
classes exist in the cache.  If they don't, they're created at
runtime.  If they do, it's a no-op.

So there's no need for me to tell users to run MakePY, nor for me to
copy the generated classes into my project somehow.  Great!

Michael



More information about the Python-list mailing list