I know there are some topic on Stack Overflow about this. But none of these make any sense to me. I am new to both python and perl and trying my best to understand. I would like to run a perl script from a piece of python code.
executing the perl script in command prompt goes as following:
perl perlscript.pl input.bopt7 output.xml
I would like to run this command from my python code.
I have tried the following:
pipe = subprocess.Popen(["perlscript.pl" , "input.bopt7" , "output.xml"], stdout=subprocess.PIPE)
but this does not work. I get an error saying it is not a valid win32 …
I need no input or output from this script. Just need to run it once.
You need to include the
perlcommand itself when executing a perl script:You did the same thing on the command line prompt; the
Popenclass cannot guess from theperlscript.plfile that you wanted to run this script with Perl. 🙂