Unfortunately, this does not work.
To elaborate a little:
Positional arguments are mandatory. The quick take-away is, that a function in Python can always (and will always) be treated as having the following signature:
def some_function(*args, **kwargs):
This implies that positional arguments are basically just a list of arguments to the interpreter and will be expanded when passed to the function.
Therefore, all positional arguments need to be present when calling the function.
That is a huge difference to how named arguments are passed ("keyword arguments"):
They are a dictionary of the kind
{'parameter_name': 'parameter_value'}
They are always present as they get defined by having a default value.
To get back to your original issue:
When calling your function, the option to pass kwargs by position instead of by name may help you.
so, instead of
main(argument1, argument2 = 'default2', argument3 = 'default3')
you can always call
main(argument1, 'default2', 'default3')
instead.
Also, you may want to have a look at the argparse
library.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…