问题
I have a source code written in cpp that I want to compile and be readable in Python. Python must give 2 filenames as input and retrieve a matrix and a vector as output. If I had to do it in C/C++ I'd use 2 chars and 2 pointers but I don't know how a compiled C/C++ program can be seen for Python language.
I hope that someone can help me. Thank you very much.
回答1:
Try using Swig to generate the glue code necessary to call C/C++ code from Python. It's easier than writing the code yourself.
来源:https://stackoverflow.com/questions/9343294/how-to-compile-a-c-c-function-for-python