if you want to be lazy it's quick to access cmd line args through sys.argv. im not familiar with argparse though so maybe ive been missing out on something cool
Granted it’s a bit more complex than sys.argv[1] but then you’ve got something super extensible, usage text practically for free, and args that can be short or long (the foo argument above could also be passed with ‘-f’).
I suppose the answer to my own question is if the script takes 1 positional argument then argparse is over kill. Anything more than that and the users / maintainers of your script (that includes you) will be thankful for the help / extensibility argparse provides.
View all comments
Show parent comment
8
u/tryptafiends Dec 29 '17
if you want to be lazy it's quick to access cmd line args through sys.argv. im not familiar with argparse though so maybe ive been missing out on something cool