Thursday 15 January 2015

Python: subprocess and running a bash script with multiple arguments -


How do I know about running a bash script using the subprocess module, for which I have many arguments?

This is what I am currently using:

  subprocess. POPEAN (['/ my / file / path / programname.sh', 'arg1 arg2% s'% arg3], \ shell = true)   

Do not take any parameters in the Bash script appears to be. No insights is much appreciated!

Pass arguments as a list, see:

  Import subprocess subprocesses. (['/ My / file / path / programname.', 'Arg1', 'arg2', arg3])   

If arg3 is not string; check_call () : arg3 = str (arg3) . Convert it to string before going through .

No comments:

Post a Comment