Use Python code in C / C ++

I work in an embedded Linux environment and I have Python code that I would like to use. My Python code just does some math without using any libraries except Numpy and the general ones.

Is there a way to create a library that I can call from C or C ++ code?

+6
source share
1 answer

Embedding the CPython interpreter in a C or C ++ program is actually quite simple.

The official documentation contains some complete examples.

Also check out SWIG and Boost.Python .

+6
source

Source: https://habr.com/ru/post/907513/


All Articles