bundles / IPython 9.17.0 / IPython / utils / text / indent
function
IPython.utils.text:indent
Signature
def indent(instr: str, nspaces: int = 4, ntabs: int = 0, flatten: bool = False) → strSummary
Indent a string a given number of spaces or tabstops.
Extended Summary
indent(str, nspaces=4, ntabs=0) -> indent str by ntabs+nspaces.
Parameters
instr: strThe string to be indented.
nspaces: int (default: 4)The number of spaces to be indented.
ntabs: int (default: 0)The number of tabs to be indented.
flatten: bool (default: False)Whether to scrub existing indentation. If True, all lines will be aligned to the same indentation. If False, existing indentation will be strictly increased.
Returns
str: string indented by ntabs and nspaces.
Aliases
IPython.core.oinspect.indent