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_AsStri ngAndSize . It gives you a pointer to a buffer
and a size. Allocate a new one and copy it if you need to modify it,
or you want a copy that outlives the object version.
Comment