running perl script with python -
let say, have perl scipt on unix: trial.pl
print ("hello" world); and python on window: python scipt:
subprocess.call("perl trial.pl",shell=true) it print "1" in gui means false, why?
it return 0 if perl script executed successfully
>>> rc = subprocess.call('perl /tmp/t.pl', shell=true) hello world >>> rc 0 so if return 1, means either perl cannot find trial.pl file (you need specify absolute path fix it) or there problem within perl script file (you can run independently verify)
Comments
Post a Comment