eye.widgets.eval_console module¶
Interactive Python evaluator console
- class eye.widgets.eval_console.EvalConsole(**kwargs)[source]¶
Bases:
QWidget
,WidgetMixin
Interactive evaluator console widget
Text typed in the console will be executed as Python code, in the context of the EYE app, which allows to do some operations on widgets directly from this console.
The editor variable is automatically set to the last focused editor widget in the current window. The window variable is set to current window. The eye module is imported, and so are the submodules already imported by the configuration files.
During execution of a line, stdout and stderr are captured and are output to this widget console. Do not execute statemements taking a lot of time as it would freeze the UI.
This widget can typically added as a dock widget.
- eye.widgets.eval_console.NAMESPACE = {'reload': <function reload>}¶
Additional shared namespace between all
EvalConsole
objects.Example:
def hello(): print('Hello world') eye.widgets.eval_console.NAMESPACE['hello'] = hello
Then, the hello() function can be called in the console.