run_script#
- Session.run_script(filename: str) ModuleType | None #
Run an EnSight Python script file.
In EnSight, there is a notion of a Python script that is normally run line by line in EnSight. In such scripts, the
ensight
module is assumed to be preloaded. This method runs such scripts by importing them as modules and running the commands through the PyEnSight interface. This is done by installing the PyEnsightSession
object into the module before it is imported. This makes it possible to use a Python debugger with an EnSight Python script, using the PyEnSight interface.Note
Because the Python script is imported as a module, the script filename must have a
.py
extension.- Parameters:
- filename
str
Filename of the Python script to run, which is loaded as a module by PyEnSight.
- filename
- Returns:
types.ModuleType
Imported module.