Connecting Tech Pros Worldwide Help | Site Map

accepting cStringIO in an extension

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 5th, 2006, 05:35 PM
garyjefferson123@yahoo.com
Guest
 
Posts: n/a
Default accepting cStringIO in an extension

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


  #2  
Old September 5th, 2006, 05:55 PM
Noah Roberts
Guest
 
Posts: n/a
Default Re: accepting cStringIO in an extension


garyjefferson123@yahoo.com wrote:
Quote:
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?

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.