🧪 Version 0.3.1 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for on_step

Specify callback for when the sketch ends execution. This is part of the reference section.

Purpose

Register a callback for when the sketch redraws. This function should expect a single parameter which is the sketch redrawing.

Snippet

Register a callback for when the sketch takes a "step" and has an opportunity to redraw.
def callback(sketch_drawing):
print('Drawing')
sketch.on_step(callback)

Parameters

  • callback: The function to invoke when the sketch stops execution.

Examples

Availability

Available for Sketch2DApp and Sketch2DWeb.

See also