Back to index

salome-gui  6.5.0
PyConsole_Interp Class Reference

Python interpreter to be embedded to the SALOME study's GUI. More...

Inheritance diagram for PyConsole_Interp:
Inheritance graph

Detailed Description

Python interpreter to be embedded to the SALOME study's GUI.

Python interpreter is created one per SALOME study.

Call initialize method defined in the base class PyInterp_Interp, to intialize interpreter after instance creation.

The method initialize() calls virtuals methods

/EDF-CCAR/ When SALOME uses multi Python interpreter feature, every study has its own interpreter and thread state (_tstate = Py_NewInterpreter()). This is fine because every study has its own modules (sys.modules) stdout and stderr.

But some Python modules must be imported only once. In multi interpreter context Python modules (*.py) are imported several times. For example, the PyQt module must be imported only once because it registers classes in a C module.

It's quite the same with omniorb modules (internals and generated with omniidl).

This problem is handled with "shared modules" defined in These "shared modules" are imported only once and only copied in all the other interpreters.

But it's not the only problem. Every interpreter has its own builtin module. That's fine but if we have copied some modules and imported others problems may arise with operations that are not allowed in restricted execution environment. So we must impose that all interpreters have identical builtin module.

The documentation for this class was generated from the following file: