Create a DLL in Python

Darrell news at dorb.com
Tue May 11 13:12:08 EDT 1999


> 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









More information about the Python-list mailing list