Skip to content

How can i call a python function inside c++ using pybind11? #750

@stehol01

Description

@stehol01

Hy Developers,

How can i call a python function inside C++? I found a closed issue (#30) where this question was asked by @skebanga but it seems that his question was not fully answered.

For example: I have a python function myfun

def myfun(i, j):
out = i + j
return out

Now i would like to call this function inside visual studio 2015. How can i do this? :P
I read the docs and tried to figure out how the test_callbacks.cpp/test_callbacks.py works but i really dont get it. Is there somewhere else a simple example how to do this?

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions