[python-win32] Boot strap mechanism for ActiveX Python engines

Mark Hammond skippy.hammond at gmail.com
Wed May 5 06:55:06 CEST 2010


On 5/05/2010 5:33 AM, Marc-Andre Belzile wrote:
> Hi,
>
> I'm trying to execute some python code when a new ActiveX Python engine
> is instantiated. I thought I could use sitecustomize.py to put my code
> in but this module seems to get executed only for the first engine
> created (probably when pythoncomXX.dll is loaded for the first time).
>
> Is there a different python module I can rely on when a new engine is
> created ? Or maybe there is another way to call a python script when a
> new engine is created ?

Your best bet is probably to create your own subclass of the axscript 
implementation (with different CLSID) and override (eg) InitNew to take 
some action as the engine is initialized.

Cheers,

Mark


More information about the python-win32 mailing list