Wednesday, 15 January 2014

Subprocess call with arguments as variables python -


Hi, I'm quite new to Python and I'm trying to call a subprocess using another process using Python script. But my argument is variable names, so do I have subprocess Call or subprocess Should Peepel use?

I want to execute the following commands from another Python script:

  dragon npp.python -i fname -o fname + "out" -l fname + "log "-e what should i do  
  subprocess. Popen (['Python', 'NPA Pathith', '-i', Fname, 'o', fname + "out", "-l", fname + "log", '-e', exclamation, '- , Iglix]). Dialog ()   

I am not able to call another program by doing this. Any suggestions on what I'm doing wrong?

PJust is a very easy way to do something that is already ordering it.

  command = "python npp.python -i {file} -o {file} .out -l {file} .log -e {excep} -i {ignore}". Format (file = pipe.name (fname), excep = exceptlist, ignored = unknown list) subprocess. (Shlex.split command)) # shlex.split is safe for # shell commands from the normal partition, if the return code does not require subprocess. Popin (shlex.split (command)   

It's hard to mistake your order in the list form.

No comments:

Post a Comment