MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / put_row

Function put_row

pywebio/output.py:1295–1332  ·  view source on GitHub ↗

Use row layout to output content. The content is arranged horizontally :param list content: Content list, the item is ``put_xxx()`` call or ``None``. ``None`` represents the space between the output :param str size: | Used to indicate the width of the items, is a list of width values

(content: List[Union[Output, None]] = [], size: str = None, scope: str = None,
            position: int = OutputPosition.BOTTOM)

Source from the content-addressed store, hash-verified

1293
1294@safely_destruct_output_when_exp('content')
1295def put_row(content: List[Union[Output, None]] = [], size: str = None, scope: str = None,
1296 position: int = OutputPosition.BOTTOM) -> Output:
1297 """Use row layout to output content. The content is arranged horizontally
1298
1299 :param list content: Content list, the item is ``put_xxx()`` call or ``None``. ``None`` represents the space between the output
1300 :param str size:
1301 | Used to indicate the width of the items, is a list of width values separated by space.
1302 | Each width value corresponds to the items one-to-one. (``None`` item should also correspond to a width value).
1303 | By default, ``size`` assigns a width of 10 pixels to the ``None`` item, and distributes the width equally to the remaining items.
1304
1305 Available format of width value are:
1306
1307 - pixels: like ``100px``
1308 - percentage: Indicates the percentage of available width. like ``33.33%``
1309 - ``fr`` keyword: Represents a scale relationship, 2fr represents twice the width of 1fr
1310 - ``auto`` keyword: Indicates that the length is determined by the browser
1311 - ``minmax(min, max)`` : Generate a length range, indicating that the length is within this range.
1312 It accepts two parameters, minimum and maximum.
1313 For example: ``minmax(100px, 1fr)`` means the length is not less than 100px and not more than 1fr
1314
1315 :param int scope, position: Those arguments have the same meaning as for `put_text()`
1316
1317 :Example:
1318
1319 .. exportable-codeblock::
1320 :name: put_row
1321 :summary: `put_row()` usage
1322
1323 # Two code blocks of equal width, separated by 10 pixels
1324 put_row([put_code('A'), None, put_code('B')])
1325 ## ----
1326
1327 # The width ratio of the left and right code blocks is 2:3, which is equivalent to size='2fr 10px 3fr'
1328 put_row([put_code('A'), None, put_code('B')], size='40% 10px 60%')
1329
1330 """
1331 return _row_column_layout(content, flow='column', size=size, scope=scope,
1332 position=position).enable_context_manager()
1333
1334
1335@safely_destruct_output_when_exp('content')

Callers 4

mainFunction · 0.90
basic_outputFunction · 0.85
output_widgetsFunction · 0.85
mainFunction · 0.85

Calls 2

_row_column_layoutFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…