run_python_script#

Optislang.run_python_script(script: str, args: Sequence[object] | None = None) Tuple[str, str]#

Load a Python script in a project context and run it.

Parameters:
scriptstr

Python commands to execute on the server.

argsSequence[object], None, optional

Sequence of arguments used in the Python script. The default is None.

Returns:
Tuple[str, str]

STDOUT and STDERR from the executed Python script.

Raises:
OslCommunicationError

Raised when an error occurs while communicating with the server.

OslCommandError

Raised when a command or query fails.

TimeoutError

Raised when the timeout float value expires.

Deprecated since version 0.6.0: This functionality was moved to Project.