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

argparse.RawDescriptionHelpFormatter

Prev: argparse.Namespace | Up: argparse | Next: argparse.RawTextHelpFormatter
Rel: argparse.Action, argparse.ArgumentDefaultsHelpFormatter, argparse.ArgumentError, argparse.ArgumentParser
Ref: docs.python.org — argparse.RawDescriptionHelpFormatter
Tags: #public #python3 #stdlib #argparse


Import

import argparse
from argparse import RawDescriptionHelpFormatter

Signature & Overview

argparse.RawDescriptionHelpFormatter(prog, indent_increment=2, max_help_position=24, width=None, color=True)

Help message formatter which retains any formatting in descriptions.

Methods & Attributes

Usage

import argparse

desc = "Line 1\n  Indented line 2"
p = argparse.ArgumentParser(description=desc, formatter_class=argparse.RawDescriptionHelpFormatter)
assert "  Indented line 2" in p.format_help()

Gotchas

REPL Inspect

from argparse import RawDescriptionHelpFormatter
help(RawDescriptionHelpFormatter)

Linked from

Related notes