Skip to content

Best practice to Share histogram between c++ and python #400

Answered by HDembinski
MaxSac asked this question in Q&A
Discussion options

You must be logged in to vote

You need to initialize the Python interpreter before you can call the Python API. See
https://pybind11.readthedocs.io/en/stable/advanced/embedding.html
You need to add this line:

    py::scoped_interpreter guard{}; // start the interpreter and keep it alive

The rest looks good.

Replies: 1 comment 18 replies

Comment options

You must be logged in to vote
18 replies
@HDembinski
Comment options

@MaxSac
Comment options

@MaxSac
Comment options

@HDembinski
Comment options

Answer selected by MaxSac
@MaxSac
Comment options

@MaxSac
Comment options

@HDembinski
Comment options

@HDembinski
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants