Function
textwrap.dedent

Signature

dedent(text)

Documentation String

dedent(text : string) -> string

Remove any whitespace than can be uniformly removed from the left of every line in `text`.

This can be used e.g. to make triple-quoted strings line up with the left edge of screen/whatever, while still presenting it in the source code in indented form.

For example:

def test(): # end first line with \ to avoid the empty line! s = ''' hello world '' print repr(s) # prints hello world ' print repr(dedent(s)) # prints hello world