1

Let's say I have a module where I define a Animal class in Python. It has some simple attributes like height and weight. And let's say it has a couple simple member functions like getHeight() and makeSound().

I also have a non-member function returnAnimal() that simply returns a new instance of an Animal

I've embedded the python interpreter in a C++ function using the Python C API. From here I know how to run python functions that have return types like int, char*, etc.

But how can I accept functions with user defined types, such as my Animal class?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.