viewport_grid#

Workspace.viewport_grid() → list[list[Viewport]]#

Return viewports as a grid of rows and columns.

A viewport that spans several cells appears once per cell that it occupies.

Returns:
list[list[Viewport]]

Viewports grouped by row, from top to bottom and left to right.

Examples

Get the viewport in the lower-right corner.

>>> grid = workspace.viewport_grid()
>>> lower_right = grid[-1][-1]