Embedding to C++: hooking up GNU readline

Alex Farber eedalf at eed.ericsson.se
Mon Feb 28 16:18:52 CET 2000


Dear friends,

I have a C++ application which embeds Python. To use the GNU readline 
library for input I run a separate thread, which calls readline(">>> "), 
then processes the input and passes the received char array to another 
function. And that function is hooked up to PyOS_ReadlineFunctionPointer.

It works, but I have a problem: How do I know when to change the prompt 
from ">>> " to "... "? Is there some flag which I could check before 
calling readline(">>> ") or readline("... ")?

Thank you for any hints
Alex



More information about the Python-list mailing list