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 PyEnsight Session 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:
filenamestr

Filename of the Python script to run, which is loaded as a module by PyEnSight.

Returns:
types.ModuleType

Imported module.