The PyObject str_sentence is a string representation of a list. I need to convert the list to a string like "".join because that's what the library call takes.
Mar 7, 2022, 09:09 by [email protected]: > On Tue, 8 Mar 2022 at 04:06, Jen Kris via Python-list > <[email protected]> wrote: > >> But with the C API it looks like this: >> >> PyObject *pSentence = PySequence_GetItem(pSents, sent_count); >> PyObject* str_sentence = PyObject_Str(pSentence); // Convert to string >> >> PyObject* repr_str = PyObject_Repr(str_sentence); >> > > You convert it to a string, then take the representation of that. Is > that what you intended? > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
