2222The :mod: `argparse ` module makes it easy to write user-friendly command-line
2323interfaces. The program defines what arguments it requires, and :mod: `argparse `
2424will figure out how to parse those out of :data: `sys.argv `. The :mod: `argparse `
25- module also automatically generates help and usage messages and issues errors
26- when users give the program invalid arguments.
25+ module also automatically generates help and usage messages. The module
26+ will also issue errors when users give the program invalid arguments.
2727
2828
2929Core Functionality
@@ -91,8 +91,8 @@ produces either the sum or the max::
9191 args = parser.parse_args()
9292 print(args.accumulate(args.integers))
9393
94- Assuming the Python code above is saved into a file called ``prog.py ``, it can
95- be run at the command line and provides useful help messages:
94+ Assuming the above Python code is saved into a file called ``prog.py ``, it can
95+ be run at the command line and it provides useful help messages:
9696
9797.. code-block :: shell-session
9898
@@ -119,7 +119,7 @@ the command-line integers:
119119 $ python prog.py 1 2 3 4 --sum
120120 10
121121
122- If invalid arguments are passed in, it will issue an error :
122+ If invalid arguments are passed in, an error will be displayed :
123123
124124.. code-block :: shell-session
125125
@@ -159,7 +159,7 @@ used when :meth:`~ArgumentParser.parse_args` is called. For example::
159159
160160Later, calling :meth: `~ArgumentParser.parse_args ` will return an object with
161161two attributes, ``integers `` and ``accumulate ``. The ``integers `` attribute
162- will be a list of one or more ints , and the ``accumulate `` attribute will be
162+ will be a list of one or more integers , and the ``accumulate `` attribute will be
163163either the :func: `sum ` function, if ``--sum `` was specified at the command line,
164164or the :func: `max ` function if it was not.
165165
@@ -555,7 +555,7 @@ disallowed.
555555fromfile_prefix_chars
556556^^^^^^^^^^^^^^^^^^^^^
557557
558- Sometimes, for example when dealing with a particularly long argument lists, it
558+ Sometimes, when dealing with a particularly long argument lists, it
559559may make sense to keep the list of arguments in a file rather than typing it out
560560at the command line. If the ``fromfile_prefix_chars= `` argument is given to the
561561:class: `ArgumentParser ` constructor, then arguments that start with any of the
@@ -1228,7 +1228,7 @@ Any container can be passed as the *choices* value, so :class:`list` objects,
12281228Use of :class: `enum.Enum ` is not recommended because it is difficult to
12291229control its appearance in usage, help, and error messages.
12301230
1231- Formatted choices overrides the default *metavar * which is normally derived
1231+ Formatted choices override the default *metavar * which is normally derived
12321232from *dest *. This is usually what you want because the user never sees the
12331233*dest * parameter. If this display isn't desirable (perhaps because there are
12341234many choices), just specify an explicit metavar _.
0 commit comments