python renderer: Try out function parameters
This commit is contained in:
parent
a4d84cff43
commit
95f6b31e4b
@ -27,15 +27,18 @@
|
|||||||
|
|
||||||
static PyObject *test(PyObject *self, PyObject *args)
|
static PyObject *test(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
if(!PyArg_ParseTuple(args, ":numargs"))
|
long int i;
|
||||||
|
|
||||||
|
if(!PyArg_ParseTuple(args, "l:get_number", &i))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return PyLong_FromLong(20UL);
|
i *= 2;
|
||||||
|
|
||||||
|
return PyLong_FromLong(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyMethodDef gds_render_methods[] = {
|
static PyMethodDef gds_render_methods[] = {
|
||||||
{"get_number", test, METH_VARARGS,
|
{"get_number", test, METH_VARARGS, "Return the number of arguments received by the process."},
|
||||||
"Return the number of arguments received by the process."},
|
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user