DEV Community

Discussion on: Python argparse cheat sheet

Collapse
davedavemckay profile image
David McKay

I like the use of nargs=1 which will mean your script always deals with lists and keep the code consistent, rather than leaving it out and having some lists and some strings or ints.
nargs='?' and nargs='+' are new to me so thanks for them! I use nargs='*' a lot...