process_args

pyscripts.process_args(args, drop=None, call_name='func')[source]

Process the arguments obtained by argparse.ArgumentParser.parse_args(), dropping from its values everything specified in “drop” and “call_name”. A new argparse.Namespace instance is created and returned, together with the function to be called..

Parameters:
  • args (argparse.Namespace) – arguments obtained from the parser.
  • drop (list(str) or None) – values to drop.
  • call_name (str) – name of the callable in the arguments.
Returns:

function to execute and namespace holding the remaining values.

Return type:

function, argparse.Namespace

See also

call()