I know there are other posts with same question, but I am unable to run a perl script within my python script referring those posts.
Here is the excerpt from my code:
var1 = "-proj xyz"
var2 = "-c groups"
proc2 = subprocess.Popen(["perl", "some_perl_script.pl", var1, var2], stdout=subprocess.PIPE)
proc2.stdin.write(var1)
proc2.stdin.write(var2)
proc2.stdin.close()
proc2.wait()
Note: I'm supposed to run: ./some_perl_script.pl -c groups -proj xyz
Please let me know what am I doing wrong here? Thanks!
var1andvar2to yourPopencommand, and writing them to stdin?