Mailing List Archive

Create a DLL in Python
Hello
I need to write a small Dynamic Link Library for the Win32 platform and am
unsure how to do this. I have looked at freeze but am still uncertain about
if or how it can be done.
Any help and all help will be appreciated
Matt
Create a DLL in Python [ In reply to ]
> I need to write a small Dynamic Link Library for the Win32 platform and am
> unsure how to do this.
Get swig and read these two sections in the python docs
Extending and Embedding
(tutorial for C/C++ programmers)
Python/C API
(reference for C/C++ programmers)

Then get the source that someone else has used to create such a dll as a
starting point. Here's one I've been playing with using swig.
http://www.dorb.com/darrell/

Note: .dll becomes .pyd and for debug code use xxx_d.pyd and run it with
python_d.exe.

If what you are asking is how to create something that is callable from say
VB.
Then look at the COM stuff. http://www.python.org/windows/
Maybe a COM server would make you happy.

Or if you are looking to call this .dll directly then this sounds like
embedding. You can call python from C. Check out the Embedding doc.

--Darrell