[Python-Dev] Triple-quoted strings and indentation

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>
> 
> Options:
>   -c  - blah blah
>   -f <filename>  - do stuff with file "filename"
>   -s  - more blah"""

Isn't the standard idiom for this already:

import textwrap
...
    print textwrap.dedent("""\
        Usage: dostuff <options>

        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