Ice.loadSlice

Ice.loadSlice = <built-in function loadSlice>

list[str]) -> None

Compiles Slice definitions and loads the generated code directly into the current Python environment.

This function does not generate any Python source files. Instead, the generated Python code is loaded directly into the running interpreter.

This function does not generate any code for Slice files included by the Slice files being loaded. It is the caller’s responsibility to load all necessary Slice definitions. This can be done in a single call to loadSlice() by providing all Slice files (including included files) in the args parameter, or by making multiple calls to loadSlice().

When loadSlice() is called multiple times with the same Slice file, the corresponding Python code is not reloaded.

Parameters:

args (list[str]) –

The list of command-line arguments for the Slice loader. These arguments may include both compiler options and the Slice files to compile.

Supported compiler options:

  • -DNAME Define NAME as 1.

  • -DNAME=DEF Define NAME as DEF.

  • -UNAME Remove any definition for NAME.

  • -IDIR Put DIR in the include file search path.

  • -d, –debug Print debug messages.

Raises:

RuntimeError – If an error occurs during Slice parsing or compilation.

Type:

loadSlice(args