Python group input arguments to be passed to another program

  python

I’m writing a wrapper script in python which should run another python script and pass along some options from the user as is.

The command line would look like:

myscript -pass_on -- -opt1 o1 -opt2 -opt3 ... --

The resulting command would be:

sub_script -opt1 o1 -opt2 -opt3 ...

sub_script can be in any scripting language
Is there a way to do this using argparse.ArgumentParser?

Source: Python Questions

LEAVE A COMMENT