J
JW
Hi,
Below is a description of what I would like to do. Would someone tell
me if it is possible and if so, how?
I have an array (presumably 'large') that is mallocced in a C function
and its
values are initialized in that same function.
I would like to pass just the pointer to the beginning of the array
from this C function to a Pyton function.
Then the python method can individually access and MODIFY individual
members of the array.
After the call to the python method, the C function will see any
changes to the array.
Can this be done?
I know how to create a PyTuple_New and change each member of the C
array into a PyObject, then add all thos PyObjects to the Tuple,
before passing that PyTyple from C to Python, but this seems slow.
Thanks in advance for your help.
Below is a description of what I would like to do. Would someone tell
me if it is possible and if so, how?
I have an array (presumably 'large') that is mallocced in a C function
and its
values are initialized in that same function.
I would like to pass just the pointer to the beginning of the array
from this C function to a Pyton function.
Then the python method can individually access and MODIFY individual
members of the array.
After the call to the python method, the C function will see any
changes to the array.
Can this be done?
I know how to create a PyTuple_New and change each member of the C
array into a PyObject, then add all thos PyObjects to the Tuple,
before passing that PyTyple from C to Python, but this seems slow.
Thanks in advance for your help.