eastlakeside / interpy-zh

📘《Python进阶》(Intermediate Python - Chinese Version)
https://py.eastlakeside.cn
Apache License 2.0
6.45k stars 1.33k forks source link

使用C扩展部分 Python/C API 有问题 #60

Open ThomasXu18 opened 5 years ago

ThomasXu18 commented 5 years ago
int n;
char *s;
PyObject* list;
PyArg_ParseTuple(args, "siO", &n, &s, &list);

PyArg_ParseTuple(args, "siO", &n, &s, &list);&n&s 的顺序写反了。 应为

int n;
char *s;
PyObject* list;
PyArg_ParseTuple(args, "siO", &s, &n, &list);