Py_BuildValue, PyArg_ParseTuple

Donn Cave donn at u.washington.edu
Wed Jul 7 11:53:15 EDT 1999


Randy Heiland <heiland at ncsa.uiuc.edu> writes:
| Here's a very simple program where I want to get back out
| (PyArg_ParseTuple) what I put in (Py_BuildValue) - however, I can't seem
| to do that.  Can someone PLEASE enlighten me?
...
|  pobj = Py_BuildValue("s#", ba,3);
...
|  PyArg_ParseTuple(pobj,"s#", &cstr,&len);

I'm just guessing, from the name, that PyArg_ParseTuple() expects a tuple.
If it's important to get a tuple here, you could try
Py_BuildValue("(s#)", ba, 3)

	Donn Cave, University Computing Services, University of Washington
	donn at u.washington.edu




More information about the Python-list mailing list