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

optparse.TitledHelpFormatter

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


Import

import optparse
from optparse import TitledHelpFormatter

Signature & Overview

optparse.TitledHelpFormatter(indent_increment=0, max_help_position=24, width=None, short_first=0)

Format help with underlined section headers.

Methods & Attributes

Usage

import optparse

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

Gotchas

REPL Inspect

from optparse import TitledHelpFormatter
help(TitledHelpFormatter)

Linked from

Related notes