accepting cStringIO in an extension

  • Thread starter garyjefferson123
  • Start date
G

garyjefferson123

I want to accept a cStringIO object in a function in a python extension
module. How do I do this?

e.g.,

static PyObject *myfunc(PyObject *self, PyObject *args)
{
PyObject *cstringio;
if (!PyArg_ParseTuple(args, "O:cStringIO", &cstringio)) {
PyErr_SetString(PyExc_ValueError, "value must be a
cstringio");
return NULL;
}
/* how to get at the data buffer or call read() on cstringio? */
}

I understand that I probably want PyEval_CallObject(), but I don't know
how to get at the read() method of cstringio.

Thanks,
Gary
 
N

Noah Roberts

I want to accept a cStringIO object in a function in a python extension
module. How do I do this?

What makes you think this is the right place to ask? Isn't there
support avenues for the extension api you are using?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top