subprocess - Python: How to pass ARGV parameters to another script? -
subprocess - Python: How to pass ARGV parameters to another script? -
i need create wrapper script gets parameters shell , passes of them are, script.
in perl, do:
system("/path/to/subprocess", @argv);
is there way same thing in python?
call subprocess.call
sys.argv
minus first element, name of python script.
import subprocess import sys subprocess.call(["/path/to/subprocess"] + sys.argv[1:])
example date
subprocess:
$ python3 s.py tue oct 21 09:25:00 cest 2014 $ python3 s.py -r tue, 21 oct 2014 09:25:01 +0200
python subprocess argv
Comments
Post a Comment