Embedding Python - Win32 - Request for Info/Opinions

Frank McGeough frank.mcgeough at synchrologic.com
Thu Apr 22 10:34:57 EDT 1999


Hi,

I've gotten Python to embed in a Win32 COM dll. (It's very simple, thanks to
everyone that worked on the PCBuild stuff). I wanted to ask a couple of
general questions because I'm curious about how I can use this in an actual
app.

What do I need to install when I put this on a target machine? I start off
with creating a Python directory.  If I put my COM dll, atl.dll and the
python15.dll in this directory I can get my wrapper to register...but do I
need to set PythonPath? do I need to install common py files? Where would I
put these? Do I just mirror (in a very small way) what the Python install
does? What is commonly done by people who are using Python commercially?

If I want to use win32com stuff what else do I need to install? Again, does
it mirror the Python Windows install? I would think I grab the following
files:
In win32com directory :
__init__.pyc, olectl.pyc, storagecon.pyc, util.pyc
In client directory:
All the pyc files
In server directory:
All the pyc files
And I'd put them in a directory structure that mirrors the install under the
directory where I'll put the python dll. Is this correct?

Is the Python interpreter thread-safe? In what I've done so far I've got an
in-proc dll marked as free-threaded. I have a com object that wraps the
Python interpreter and lets me pass files or strings into the interpreter.
What I want is to instantiate this COM object from different threads and
have those threads run scripts. Is this going to work? What have people done
to achieve the same kind of functionality? That is, use Python in a server
environment and get lots of different scripts executing at the same time. Do
they launch the interpreter at the command line as a separate process?

I am going to be working over the next couple days to answer these questions
on my own but if someone already has the answers then that would help me
quite a bit.

Thank you.
--
Frank McGeough
Synchrologic,Inc. www.synchrologic.com
E-mail: fm at synchrologic.com






More information about the Python-list mailing list