Skip to content

This page describes Revolution release 3.1.0.

Search these docs, or ask Revo a question — answers link the pages they came from.

Schedule parameters in Python


When Python runs as a step in a schedule (Run Python or Run Python Script), it can read and write that schedule’s parameters through revo.parameters:

import revo
count = revo.parameters["PlateCount"] # read by name
revo.parameters["PlateCount"] = count + 1 # write by name
done = revo.parameters.AllPlatesDone # or use the name as an attribute
  • revo.parameters reads and writes the parameters declared on the schedule, so declare a parameter there before a Python step uses it (see Schedule parameters).
  • The value written must suit the parameter’s type.
  • Reads and writes apply to the thread the step runs on.
  • revo.parameters is available to Python running as a schedule step.

A common use is a decision that needs more than an expression: a Python step works out the answer and writes it to a Boolean parameter, and an If..Else step then branches on that parameter.

A value one block writes is visible to the blocks after it on the same schedule thread, and a later schedule step reads it as ${name}. Here the schedule declares a whole-number parameter named plates sealed, with Input off because the scripts set it. An earlier block seeds the count:

import revo
revo.parameters.plates_sealed = 0 # by its Python name
print(revo.parameters["plates sealed"]) # or by its real name: the same parameter

A later block on the same thread reads it back and branches:

import revo
sealed = int(revo.parameters.plates_sealed or 0)
if sealed == 0:
print("Nothing sealed yet on this schedule thread.")
revo.parameters.plates_sealed = sealed + 1