2

I have working software which is built in Visual C++. Now, I have to convert some module of this software to Python. I want to send an array to the Python module from a C++ program, run a Python script and return a value to the main C++ program. I see Python.boost and pybind11 and tried to build and use but, I could not build it properly. Is there any other library, which does not require it to be built, that I can directly use in my environment?

  • Are you looking for a header-only library? As, otherwise - you would have to build it. Or do you mean you want pre-built binaries? You can get pre-built Boost binaries for various platforms (including Windows I believe). – einpoklum Mar 13 '17 at 19:24
  • Why do you need a library? the C++ program can run a Python script an capture its output. See this question for instance – Mawg says reinstate Monica Aug 17 '18 at 8:38
1

There are three alternatives which come to my mind.

SWIG

SWIG is an external program which you feed your C++ header file and which generates the Python interface code for you.

Boost.Python

Boost.Python is a high-level object oriented interface to the Python C-API.

pybind11

Is the successor of Boost.Python. It uses C++11 to provide more convenient interfaces.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.