Making DLL from a Python program?

Hung Jung Lu hungjunglu at yahoo.com
Wed Oct 16 09:43:56 EDT 2002


Hi,

For packaging Python into Windows executables, there
are many methods (Py2Exe, Python Installer, Freeze,
Squeeze, etc.)

What about DLLs? Of course one way is to use the
embedding mechanism: writing C++ code, and embed
Python scripts in there. But are there some other
ways?

I think that if Python programs could be made into
DLLs, that'll be wonderful. It opens up many doors.
>From Visual C++'s point of view, it does not seem that
hard... (I could be wrong, though.) Any insights or
pointers?

(Of course I am think about multiple DLL files. And I
know Python modules in C++ are a special kind of
Windows DLLs.)

(My need is the following: Python is great for many
things, but calling Python from Office applications
like Excel is a bit awkward, I have used win32com but
that requires registration of COM objects... many
users don't have admin privilege for that. If I use an
executable for the Python part, the problem is data
communication with Excel is not nice: file operations
are often needed. DLL seems to be the right way to go.
Besides, once it's in the DLL form, one can use it
even from Fortran.)

thanks,

Hung Jung






__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com




More information about the Python-list mailing list