How to embed a Python interpreter in a PyQT widget
- by Mathias
I want to be able to bring up an interactive python terminal from my python application. Some, but not all, variables in my program needs to be exposed to the interpreter.
Currently I use a sub-classed and modified QPlainTextEdit and route all "commands" there to eval or exec, and keep track of a separate namespace in a dict. However there got to be a more elegant and robust way! How?
Here is an example doing just what I want, but it is with IPython and pyGTK...
http://ipython.scipy.org/moin/Cookbook/EmbeddingInGTK