run_python_file#
- Optislang.run_python_file(file_path: str | Path, args: Sequence[object] | None = None) Tuple[str, str]#
Read a Python script from a file, load it in a project context, and run it.
- Parameters:
- file_path
Union[str,pathlib.Path] Path to the Python script file with the content to execute on the server.
- args
Sequence[object],None,optional Sequence of arguments to use in the Python script. The default is
None.
- file_path
- Returns:
- Raises:
FileNotFoundErrorRaised when the specified Python script file does not exist.
OslCommunicationErrorRaised when an error occurs while communicating with the server.
OslCommandErrorRaised when a command or query fails.
TimeoutErrorRaised when the timeout float value expires.
Deprecated since version 0.6.0: This functionality was moved to
Project.