First page Back Continue Last page Overview Image

Beispiele für PyArg_ParseTuple

int ok;

int i, j;

long k, l;

char *s;

Keine Argumente:

ok = PyArg_ParseTuple(args, "");

/* Python call: f() */

Ein String:

ok = PyArg_ParseTuple(args, "s", &s);

/* Possible Python call: f('whoops!') */

Zwei „long“s und ein String:

ok = PyArg_ParseTuple(args, "lls", &k, &l, &s);

/* Possible Python call: f(1, 2, 'three') */