Theme
Auto
Light
Dark
Table of Contents
argparse
— Parser for command-line options, arguments and subcommands
ArgumentParser objects
prog
usage
description
epilog
parents
formatter_class
prefix_chars
fromfile_prefix_chars
argument_default
allow_abbrev
conflict_handler
add_help
exit_on_error
suggest_on_error
color
The add_argument() method
name or flags
action
nargs
const
default
type
choices
required
help
metavar
dest
deprecated
Action classes
The parse_args() method
Option value syntax
Invalid arguments
Arguments containing
-
Argument abbreviations (prefix matching)
Beyond
sys.argv
The Namespace object
Other utilities
Subcommands
FileType objects
Argument groups
Mutual exclusion
Parser defaults
Printing help
Partial parsing
Customizing file parsing
Exiting methods
Intermixed parsing
Registering custom types or actions
Exceptions
Previous topic
Command-line interface libraries
Next topic
Argparse Tutorial