Re: How do I convert a PyObject to string in C++?

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 9:32 pm, [EMAIL PROTECTED] wrote: > I have a PyObject, say 'Hello World' , a string, > How do I convert it to a string in C++? > Thanks in advance! Look at PyString_AsStringAndSize . It gives you a pointer to a buffer and a size. Allocate a new one and copy it if you need to modify it

Re: How do I convert a PyObject to string in C++?

2008-09-22 Thread js
PyString_AsString returns a c string. Just feed it to std::string http://docs.python.org/api/stringObjects.html#l2h-472 On Tue, Sep 23, 2008 at 11:32 AM, <[EMAIL PROTECTED]> wrote: > I have a PyObject, say 'Hello World' , a string, > How do I convert it to a string in C++? > Thanks in advance! >

How do I convert a PyObject to string in C++?

2008-09-22 Thread lixinyi . 23
I have a PyObject, say 'Hello World' , a string, How do I convert it to a string in C++? Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list