On this page
optparse.HelpFormatter
Prev: optparse.check_choice | Up: optparse | Next: optparse.IndentedHelpFormatter
Rel: optparse.BadOptionError, optparse.check_choice, optparse.IndentedHelpFormatter, optparse.make_option
Ref: docs.python.org — optparse.HelpFormatter
Tags: #public #python3 #stdlib #optparse
Import
import optparse
from optparse import HelpFormatter
Signature & Overview
optparse.HelpFormatter(indent_increment, max_help_position, width, short_first)
Abstract base class for formatting option help. OptionParser instances should use one of the HelpFormatter subclasses for formatting help; by default IndentedHelpFormatter is used.
Methods & Attributes
HelpFormatter.dedent(self)—HelpFormatter.dedentmethod/property.HelpFormatter.expand_default(self, option)—HelpFormatter.expand_defaultmethod/property.HelpFormatter.format_description(self, description)—HelpFormatter.format_descriptionmethod/property.HelpFormatter.format_epilog(self, epilog)—HelpFormatter.format_epilogmethod/property.HelpFormatter.format_heading(self, heading)—HelpFormatter.format_headingmethod/property.HelpFormatter.format_option(self, option)—HelpFormatter.format_optionmethod/property.HelpFormatter.format_option_strings(self, option)— Return a comma-separated list of option strings & metavariables.HelpFormatter.format_usage(self, usage)—HelpFormatter.format_usagemethod/property.HelpFormatter.indent(self)—HelpFormatter.indentmethod/property.HelpFormatter.set_long_opt_delimiter(self, delim)—HelpFormatter.set_long_opt_delimitermethod/property.HelpFormatter.set_parser(self, parser)—HelpFormatter.set_parsermethod/property.HelpFormatter.set_short_opt_delimiter(self, delim)—HelpFormatter.set_short_opt_delimitermethod/property.HelpFormatter.store_option_strings(self, parser)—HelpFormatter.store_option_stringsmethod/property.
Usage
import optparse
assert issubclass(optparse.IndentedHelpFormatter, optparse.HelpFormatter)
Gotchas
- Abstract base class for
IndentedHelpFormatterandTitledHelpFormatter.
REPL Inspect
from optparse import HelpFormatter
help(HelpFormatter)
Linked from
- tuts/python3/stdlib_module/optparse
- tuts/python3/stdlib_module/optparse/BadOptionError
- tuts/python3/stdlib_module/optparse/check_choice
- tuts/python3/stdlib_module/optparse/IndentedHelpFormatter
- tuts/python3/stdlib_module/optparse/make_option
- tuts/python3/stdlib_module/optparse/Option
- tuts/python3/stdlib_module/optparse/OptionConflictError
- tuts/python3/stdlib_module/optparse/OptionContainer
- tuts/python3/stdlib_module/optparse/OptionError
- tuts/python3/stdlib_module/optparse/OptionGroup
- tuts/python3/stdlib_module/optparse/OptionParser
- tuts/python3/stdlib_module/optparse/OptionValueError
- tuts/python3/stdlib_module/optparse/OptParseError
- tuts/python3/stdlib_module/optparse/TitledHelpFormatter
- tuts/python3/stdlib_module/optparse/Values
Related notes
- tuts/python3/stdlib_module/optparse/BadOptionError Linked here; links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/check_choice Linked here; links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/IndentedHelpFormatter Linked here; links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/make_option Linked here; links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/optparse/Option links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/OptionConflictError links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/OptionContainer links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/OptionError links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/OptionGroup links to this page; shared tags: #optparse, #stdlib