Home | Trees | Indices | Help |
|
---|
|
|
|||
unicode | |||
TextWrapper Object for wrapping/filling text. |
|
|||
|
|||
|
|||
|
|
|||
__revision__ =
|
|||
_whitespace =
|
|||
__package__ =
|
|
Wrap a single paragraph of text, returning a list of wrapped lines. Reformat the single paragraph in 'text' so it fits in lines of no more than 'width' columns, and return a list of wrapped lines. By default, tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are converted to space. See TextWrapper class for available keyword args to customize wrapping behaviour. |
Fill a single paragraph of text, returning a new string. Reformat the single paragraph in 'text' to fit in lines of no more than 'width' columns, and return a new string containing the entire wrapped paragraph. As with wrap(), tabs are expanded and other whitespace characters converted to space. See TextWrapper class for available keyword args to customize wrapping behaviour. |
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 ' |
|
__revision__
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Jul 25 16:21:21 2010 | http://epydoc.sourceforge.net |