Embedding + extending without DLLs

Dan Schmidt dfan at harmonixmusic.com
Wed Jun 7 10:22:05 EDT 2000


I would like to simultaneously embed and extend Python in a Win32
project.

That is, I'm writing a C++ application which uses Python as a
scripting language, and the Python code can call back into the C++
code to perform actions or queries.

I actually already have a little toy program that does this, and it
works fine.  However, it works by having a main .exe and then a
separate foo.dll, which Python then finds with an 'import foo'
statement.

What I'd prefer is to have Python be able to call directly into my
.exe, since the project already exists as a monolithic executable and
isn't split up into DLLs.  I suppose I can turn the whole thing into a
DLL and write a tiny .exe to load it up, but I wanted to check if
there's a natural way to let Python call my code without changing the
structure of my program.  Is there?

Thanks,
Dan

-- 
                 Dan Schmidt | http://www.dfan.org
Honest Bob CD now available! | http://www.dfan.org/honestbob/cd.html



More information about the Python-list mailing list