Closed anemele closed 7 months ago
To write a Python function that takes at least one arg, have a single required positional arg followed by varargs. E.g.
def f(required, *optional):
all_args = [required] + optional
While you can't get precisely the behavior you want ("file, [file ...]"), you can get close with:
def f(file, *files):
files = [file] + files
Hi.
I have a function as follow
and use
argparse
to create cliIt needs at least one argument, given no argument will return
I want migrate to
fire
butfire
doesn't perform as expected, it returnsSo, I wonder is there any method to set the number of args?