Argument passing in Python module written in C

霸气de小男生 提交于 2019-12-04 21:40:19

The problem in the format string of PyArg_ParseTuple. You are trying to extract four double arguments, but the format string is for two double arguments and three arbitrary Python objects ("ddOOO").

The correct format string should be "dddd" for what you are trying to do. Change this

if (!PyArg_ParseTuple(args, "ddOOO", &x1, &y1, &x2, &y2))

with

if (!PyArg_ParseTuple(args, "dddd", &x1, &y1, &x2, &y2))

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