On 21/07/2010 2:45 AM, Tim Roberts wrote:
  Marc-Andre Belzile wrote:
I'm referring to Python Active Scripting engines available in pywin32. I'm 
creating them through COM, so I don't tknow if the ActiveX goes through 
Py_NewInterpreter or not.

Active Scripting creates Python as an out-of-process COM server.

The Active Scripting implementation should register so that inproc or out of proc instances can be created (which is the default for all pywin32 implemented COM objects). By default, most things which consume script engines (eg, IE, IIS) create inproc engines.

Hence, a single OS process which creates multiple script engines is sharing the same Python interpreter between instances. Py_NewInterpreter is not used by pywin32's COM support. This means a single OS process using multiple scripting engines will have each engine instance sharing the same Python 'environment' (ie, sys.path, loaded modules, etc). If you have control over the host and really want the isolated behaviour, you could try explicitly requesting an out of proc engine when calling CoCreateInstance.

HTH,

Mark
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to