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

js ebgssth at gmail.com
Mon Sep 22 22:53:59 EDT 2008


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,  <lixinyi.23 at gmail.com> wrote:
> 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
>



More information about the Python-list mailing list