Python Fundamentals: Argparse 2 of 2

Опубликовано: 21 Октябрь 2024
на канале: kishstats
2,173
26

Quick Reference
https://github.com/kishstats/Python-F...

http://kishstats.com/python-fundament...

Additional Features Covered:
nargs
number of arguments
can be a fixed number or use `+` operator (to gather into a list)
dest (--sum argument)
accumulate
accumulate attribute will be either the sum() function, if --sum was specified at the command line, or the max() function
action (--sum argument)
`store` is default
`store_const`
type
require `int`
metavar
compare with --help output
replaces argument name (integers)
mutually exclusive groups