Rogelio wrote:
> If I want to write this command to a file, would this be the right format?
>
> *
> import subprocess
>
> (all my variables defined okay)
>
> perl_script=subprocess.call(['perl',perl_prog,ipfile,cmd,user,timeout,])
>
> log=open('/tmp/pythonOutput
If I want to write this command to a file, would this be the right format?
*
import subprocess
(all my variables defined okay)
perl_script=subprocess.call(['perl',perl_prog,ipfile,cmd,user,timeout,])
log=open('/tmp/pythonOutput.txt',w)
log.write(subprocess.call(p
On Sun, May 6, 2012 at 8:23 PM, Martin A. Brown wrote:
> Or, if I were in your shoes, I would do something a bit more like
> this:
>
> cmd = [ '/usr/bin/perl', '/path/to/perlprog.pl', '-h' ]
> subprocess.call(cmd)
Thank you, Martin. This was helpful. Installed Strace and found out
that I mis
Hello,
: perl_prog = "perl perlprog.pl"
: perl_prog_h ="-h"
: #this is where it breaks
: subprocess.call([perl_prog, perl_prog_h])
This is asking your Linux to search your $PATH and execute a program
called:
'perl perlprog.pl'
Rather than to execute a program called 'perl' and pass as t
I am new to Python and am trying to figure out how to execute Linux
commands via a Python wrapper.
This works
**
#this works okay
import subprocess
uname = "uname"
uname_arg = "-a"
subprocess.call([uname,uname_arg])
**
But this doesn't.