How to embed a Python interpreter in a PyQT widget

后端 未结 5 1973
忘掉有多难
忘掉有多难 2020-11-29 00:49

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.

5条回答
  •  醉梦人生
    2020-11-29 01:36

    It sounds like you did something similar to my Veusz application, https://veusz.github.io/. I thought you might find it useful to see a more complete implementation. I can't post hyperlinks but have a look at windows/consolewindow.py for the widget class. Commands are executed by the document/commandinterpreter.py class. The interface is defined in document/commandinterface.py. It's mostly done manipulating a dict however.

提交回复
热议问题