By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

accepting cStringIO in an extension

P: n/a
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

Sep 5 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

ga**************@yahoo.com wrote:
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?

Sep 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.