[Python-Dev] Triple-quoted strings and indentation (original) (raw)

Steven Bethard steven.bethard at gmail.com
Wed Jul 6 06:29:22 CEST 2005


On 7/5/05, Andrew Durdin <adurdin at gmail.com> wrote:

print """Usage: dostuff

Options: -c - blah blah -f - do stuff with file "filename" -s - more blah"""

Isn't the standard idiom for this already:

import textwrap ... print textwrap.dedent("""
Usage: dostuff

    Options:
     -c  - blah blah
     -f <filename>  - do stuff with file "filename"
     -s  - more blah""")

STeVe

You can wordify anything if you just verb it. --- Bucky Katt, Get Fuzzy



More information about the Python-Dev mailing list