Hello,
I am looking for a way to convert Python code (using numpy, scipy maybe, and other libraries) into a file .dll which can be used by other langage as C or C++. This is to avoid to recode all my algorithms in C++ to create pure C++ dll.
Your tool Nuitka seems to achieve this goal. Am i wrong ? I find before Cython but with this library I have to recode all my Python file so it is not very cool.
I am sorry to disturb you whereas there is a website but I am such a newbie in this that it is difficult to understand all the aspects.
Thank you in advance for your answer
You need to create an extension module with Nuitka. It has the module mode (default) and can include all the needed code if you provide --recurse-all.
But to use it in C++, you need to do all the same things you need to do if you are using Python from C++. i.e. you embed a Python interpreter and load it. This is for Python2, but Python3 is the same:
https://docs.python.org/2/extending/embedding.html
If performance is not an issue, you do not need Nuitka at all, and can use Python from C++ as described there.
@kayhayen Can you please tell me how I can create a DLL using the Nuitka? I am using Windows 10. I have Visual Studio, not for python but I have it for C programming.
I ope to hear from you soon.
You cannot create DLLs with Nuitka.
@kayhayen Thank you for your reply.
Most helpful comment
You need to create an extension module with Nuitka. It has the module mode (default) and can include all the needed code if you provide --recurse-all.
But to use it in C++, you need to do all the same things you need to do if you are using Python from C++. i.e. you embed a Python interpreter and load it. This is for Python2, but Python3 is the same:
https://docs.python.org/2/extending/embedding.html
If performance is not an issue, you do not need Nuitka at all, and can use Python from C++ as described there.