On this page
  1. optparse.IndentedHelpFormatter
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

optparse.IndentedHelpFormatter

Prev: optparse.HelpFormatter | Up: optparse | Next: optparse.make_option
Rel: optparse.BadOptionError, optparse.check_choice, optparse.HelpFormatter, optparse.make_option
Ref: docs.python.org — optparse.IndentedHelpFormatter
Tags: #public #python3 #stdlib #optparse


Import

import optparse
from optparse import IndentedHelpFormatter

Signature & Overview

optparse.IndentedHelpFormatter(indent_increment=2, max_help_position=24, width=None, short_first=1)

Format help with indented section bodies.

Methods & Attributes

Usage

import optparse

p = optparse.OptionParser(formatter=optparse.IndentedHelpFormatter())
assert "Usage:" in p.format_help()

Gotchas

REPL Inspect

from optparse import IndentedHelpFormatter
help(IndentedHelpFormatter)

Linked from

Related notes