In python2.7, the argparse module has an add_argument method that can take a variable number of unnamed arguments before its keyword arguments, as shown below:
parser = argparse.ArgumentParser(description='D')
parser.add_argument('-a', '-b', ... '-n', action='store', ... <other keyword args>)
As far as I know, the function definitions below do not work:
def fxn(var_args*, action, otherstuff):
def fxn(action, otherstuff, var_args*):
What are the proper ways to emulate behavior add_argument?
source
share