Closed perara closed 7 years ago
I'm not familiar with C++/Python interop, but really all you should have to do is convert the C++ buffer to a Python byte array, at which point you can use the existing API.
Your call to PyCapsule_New
only takes a pointer, and not a length, so clearly isn't constructing a byte array, so likely there isn't a way for the Python API to get at the bytes.
What i want is to retreive a buffer made in C++ in Python (Via memory) I'm trying to retrieve a buffer from memory which were created in C++. Basically i created a flatbuffer the following way in C++:
What the above function does (C++) is:
Then in python:
So my question is how do i actually return the buffer now that i have the offset in python? I have flatbuffer generated files in both C++ and Python but from what i can see Python does not have any methods for retrieving the buffer like in C++ (fbb->GetCurrentBufferPointer()))
Does this work at all? Any idea / Solution?