Paragraph formatting in Python
import textwrap hamlet = '''\ Lorum ipsum is the traditional Latin placeholder text, used when a designer needs a chunk of text for dummying up a layout. Journo Ipsum is like that, only using some of the most common catchphrases, buzzwords, and bon mots of the future-of-news crowd. Hit reload for a new batch. For entertainment purposes only.''' wrapper = textwrap.TextWrapper(initial_indent='\t' * 1, subsequent_indent='\t' * 2, width=40) for para in hamlet.splitlines(): print(wrapper.fill(para))
Output
Lorum ipsum is the traditional Latin placeholder text, used when a designer needs a chunk of text for dummying up a layout. Journo Ipsum is like that, only using some of the most common catchphrases, buzzwords, and bon mots of the future- of-news crowd. Hit reload for a new batch. For entertainment purposes only.