Python module equivalent to the unix command "fmt"?
Question: There is some module with similar functionality to the unix command
["fmt"](http://www.openbsd.org/cgi-
bin/man.cgi?query=fmt&apropos=0&sektion=0&manpath=OpenBSD%20Current&arch=i386&format=html)?.
`fmt` is pretty intelligent reflowing text and I would like to use something
similar with some big strings.


Answer: 
    import textwrap
    
    with open('long_text.txt', 'r') as f:
        long_text = f.read()
    
    # Get a list of wrapped lines (default width 70)
    long_text_lines = textwrap.wrap(long_text)
    
    # Get a single string containing the wrapped text
    # Same as: "\n".join(textwrap.wrap(long_text, ...))
    long_text_string = textwrap.fill(long_text)
    

