Compile python code into a dll

Terry Reedy tjreedy at udel.edu
Mon Sep 10 12:06:42 EDT 2012


On 9/10/2012 8:15 AM, Rolf Wester wrote:

> I have Python code that I would like to compile into a dll (I have to
> deliver a C/C++ callable dll and I don't want to reimpelement the Python
> code in C/C++). It's not for extending Python but I want to call the
> Python functions and classes from C/C++. It's more like extending C/C++
> with Python. I would be very appreciative for any help.

Cython compiles CPython to C which can be compiled by and c/c++ 
compiler. I believe it can do the above. "This makes Cython the ideal 
language for wrapping external C libraries, embedding CPython into 
existing applications, ". I think the latter is what you want to do.

http:cython.org

-- 
Terry Jan Reedy




More information about the Python-list mailing list