I think the solution is to use both. Let me explain.
Cython makes it easy to create a quick plugin using python, but itβs inconvenient (if at all possible) to make the DLL look right. You will probably have to use offline mode to enable the python runtime, and then run the generated c code so that the corresponding DLL compiles.
Conversely, elmer simplifies the creation of DLLs, but runs "clean" python code, which may not be fast enough. I assume speed is a problem because you are considering cython, not a simple attachment.
My suggestion is this: pure python code that elmer executes should import the standard python extension cython and execute code from it. That way, you don't have to hack anything ugly, and you have the best of both worlds.
Another solution to consider is to use shedskin , because in this way you can get C ++ code from your Python code, which does not depend on python runtime.
source share