joinPreservingIndentation

emlib.textlib.joinPreservingIndentation(fragments)[source]

Like join, but preserving indentation

Parameters:
  • fragments (Sequence[str]) – a list of code strings

  • maxEmptyLines – if given, the max. number of empty lines between fragments

Return type:

str

Returns:

the joint code