Skip to main content

pretty

Format value for printing to console.

def pretty(
value: str,
width: int = 80,
nl_width: int = 80,
sep: str = '\n',
**kw: Any
) - > str

Format value for printing to console.

Parameters

NameTypeDescription
valuestrThe object or string to be formatted for display.
widthint = 80The maximum number of characters per line for standard formatting.
nl_widthint = 80The maximum line width used specifically when formatting dictionaries or tuples.
sepstr = '\n'The separator character used to prefix formatted dictionaries and tuples.
**kwAnyAdditional keyword arguments passed directly to the underlying pformat function.

Returns

TypeDescription
strThe formatted string representation of the input value, adjusted for console width and indentation.