Reformat a long string, wrapping it to a specified length.
Parameters: |
|
---|
Examples
>>> string = ("Retrieve an event based on the unique origin "
... "ID numbers assigned by the IRIS DMC")
>>> print wrap_long_string(string, prefix=" * > ",
... line_length=50)
* > Retrieve an event based on
* > the unique origin ID numbers
* > assigned by the IRIS DMC
>>> print wrap_long_string(string, prefix=" * ",
... line_length=70)
* Retrieve an event based on the unique origin ID
* numbers assigned by the IRIS DMC
>>> print wrap_long_string(string, prefix=" > ",
... special_first_prefix=" * ",
... line_length=50)
* Retrieve an event based on
> the unique origin ID numbers
> assigned by the IRIS DMC
>>> problem_string = ("Retrieve_an_event_based_on_the_unique "
... "origin ID numbers assigned by the IRIS DMC")
>>> print wrap_long_string(problem_string, prefix=" ",
... line_length=40, sloppy=True)
Retrieve_an_event_based_on_the_unique
origin ID
numbers
assigned by
the IRIS DMC
>>> print wrap_long_string(problem_string, prefix=" ",
... line_length=40)
Retrieve_an_event_base d_on_the_unique origin
ID numbers assigned by
the IRIS DMC