Nicholas
Nicholas

Reputation: 1935

how to compile a C/C++ function for python

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.

Upvotes: 2

Views: 652

Answers (1)

Borealid
Borealid

Reputation: 98559

Try using Swig to generate the glue code necessary to call C/C++ code from Python. It's easier than writing the code yourself.

Upvotes: 1

Related Questions