Hi,
I hope I'm writing to the
right place.
In case I'm out of place
can you please refer to the right direction.
I have a question about the
correct way to use PyArg_Parse API function.
I'm writing a C module to
be called from python code (ver 2.3.4)
In one of the function I
have to cast the parameter into char *
It looks like
this:
PyObject* myfunc (PyObject
*self, PyObject *args)
{
char * myparam;
if (!PyArg_Parse(args, "(s)", &myparam)){
{
char * myparam;
if (!PyArg_Parse(args, "(s)", &myparam)){
.....
}
...
}
I have a few
questions:
1. is this the correct way
to cast PyObject into char*
I have tried the PyArg_ParseTuple but
for some reason didn't succeed.
2. Is the pointer above
(&myparam) is alocated by this call? ( I guess it is since the
adress changed before and after the call)
3. Who is releasing
this memory ?
I tried looking into
the code , and will continue to.
I hope you'll be
able to help me.
thanks
anyway.
-- http://mail.python.org/mailman/listinfo/python-list