site.py & COM startup

Mark Hammond MHammond at skippinet.com.au
Tue Apr 13 19:39:50 EDT 1999


Robin Becker wrote in message ...
>using Mark Hammond's win32com for a server I find that the installation
path is not
>automatically in sys.path so my base .pth files are missed and I get
troubles.
>
>I hacked site.py to fix this using the fact that sys.prefix == '' when
running a com
>server (I guess inproc).

It is indeed when run as an inproc.  The problem is that Python uses the
current executable to try and deduce the Python home.  When Python is being
used as a COM server, the host executable could be _anything_, and therefore
cant be used to locate the Python home.

So, I would like to fix this once and for all in the COM stuff, but I cant
work out a reasonable strategy for locating the Python home.

Also, FYI:  As of build 124 and later of my extensions, when you register a
COM object its path is now also automatically saved away, and automatically
used as the object is created - thus, no more errors due to your COM object
not being on the PythonPath...

Mark.






More information about the Python-list mailing list