Relative Content

Tag Archive for pythonc++ipc

Restarting the Python interpreter using Python C API

I have a C++/Qt application where I am running a Python interpreter session within the process of the main application. I have built a ‘python console’ as a QPlainTextEdit widget, which handles the input and output for the interpreter using the Python C API. The point of all this is that Python will have direct access to data that I’m holding inside the main application. All is well, except that I want to be able to end the current interpreter session and restart it without exiting the main application.