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

js ebgssth at
Tue Sep 23 04:53:59 CEST 2008

PyString_AsString returns a c string. Just feed it to std::string

On Tue, Sep 23, 2008 at 11:32 AM,  <lixinyi.23 at> wrote:
> I have a PyObject, say 'Hello World' , a string,
> How do I convert it to a string in C++?
> Thanks in advance!
> --

More information about the Python-list mailing list