Predefined Variables

Predefined variables

inputs

Object referencing all the controls wired to the inputs of the Python device.

For example, inputs[0] returns a reference to the control wired to the first input node, inputs[1] returns a reference to the control wired to the second input node, and so on.

outputs

Object referencing all the controls wired to the outputs of the Python device.

For example, outputs[0] returns a reference to the control wired to the first output node, outputs[1] returns a reference to the control wired to the second output node, and so on.

message

Text control displayed on the control surface of the Python block. Its value can be set using message.string_set(value).

state

A persistent integer variable. The default value is 0 (zero).

For an example showing how you can work with the value of the state variable, see Using the persistent state variable.

See also

Input and output control functions

Threaded script functions

Serial port control functions

Support for Python modules