sendmesg#

ensight.sendmesg(command: str | tuple, record: int = 0, display: int = 0, exception: int = 0, noexec: int = 0) int#

Executes one or more command language commands

The method can be passed a single string or a tuple of strings. In the latter case, all the strings in the tuple will be executed. For example:

ensight.sendmesg(("shell: echo A", "shell: echo B"))

executes two command language commands. The sendmesg() function provides keywords to control the display and recording of the individual commands it executes. By default, commands are executed, but not recorded in the session command log. Explicitly setting any keywords will override the defaults set by the sendmesgoptions() method.

Args:
record:

If set to 1, commands will be logged to the EnSight command journal.

display:

If set to 1, commands will echo the command text to the EnSight console.

exception:

If set to 1, and a command results in an error, a Python runtime exception will be raised.

noexec:

If set to 1, allow the record and display operations to run as selected, but actual execution of the command is suppressed.

Returns:

0 if no error and a -1 if error.