Created
April 19, 2019 15:18
-
-
Save davidnvq/54ffc50869d7864c31e22377fd18d980 to your computer and use it in GitHub Desktop.
Parse with list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
parser.add_argument( | |
"--list", | |
nargs="+", | |
help="This will accept the list of values or a single value", | |
default=['1'] | |
) | |
args = parser.parse_args() | |
# >> parser.py --list 1 2 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment