Question Details

No question body available.

Tags

python argparse

Answers (1)

Accepted Answer Available
Accepted Answer
March 11, 2026 Score: 2 Rep: 789,767 Quality: High Completeness: 50%

When you use action="store_XXX" or action="count", the option doesn't take any additional arguments -- it just stores a constant value or counts the number of occurrences of the option. So nargs is not applicable and you get an error from this inconsistent combination of parameters.

There's no error with action="store", since that does use the following arguments. nargs="*" makes it collect all the following arguments into a list.