Class: QgsCodeInterpreter

class qgis.gui.QgsCodeInterpreter

Bases: sip.wrapper

An interface for code interpreters.

New in version 3.30:

Methods

currentState

Returns the current interpreter state.

exec

Executes a command in the interpreter.

execCommandImpl

Pure virtual method for executing commands in the interpreter.

promptForState

Returns the interactive prompt string to use for the interpreter, given a state.

currentState(self) int

Returns the current interpreter state.

The actual interpretation of the returned values depend on the interpreter subclass.

Return type

int

exec(self, command: str) int

Executes a command in the interpreter.

Returns an interpreter specific state value.

Parameters

command (str) –

Return type

int

execCommandImpl(self, command: str) int

Pure virtual method for executing commands in the interpreter.

Subclasses must implement this method. It will be called internally whenever the public exec() method is called.

Parameters

command (str) –

Return type

int

promptForState(self, state: int) str

Returns the interactive prompt string to use for the interpreter, given a state.

Parameters

state (int) –

Return type

str