We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
argparse
append
1 parent 11a5fc8 commit 6e0a2faCopy full SHA for 6e0a2fa
Doc/library/argparse.rst
@@ -784,6 +784,10 @@ how the command-line arguments should be handled. The supplied actions are:
784
>>> parser.add_argument('--foo', action='append')
785
>>> parser.parse_args('--foo 1 --foo 2'.split())
786
Namespace(foo=['1', '2'])
787
+ >>> parser = argparse.ArgumentParser()
788
+ >>> parser.add_argument('--foo', action='append', default=['0'])
789
+ >>> parser.parse_args('--foo 1 --foo 2'.split())
790
+ Namespace(foo=['0', '1', '2'])
791
792
* ``'append_const'`` - This stores a list, and appends the value specified by
793
the const_ keyword argument to the list; note that the const_ keyword
0 commit comments