Python C Api transfer a PyObject * into c array

时间秒杀一切 提交于 2020-12-10 07:57:08

问题


I used python c api and wish to get an array back from python. I returned a python array from the python side and want to transfer the PyObject* result into a c array so I can use it.

Is there anyway I can do that?

Side questions: In what circumstance trying to return an element in the array like

return arr[3]

will cause the PyObject_callobject return NULL?

return arr

does give me something

来源:https://stackoverflow.com/questions/35141827/python-c-api-transfer-a-pyobject-into-c-array

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!