I have a Python script which calls Perl script using subprocess module. In terminal I run the Perl script like this:
perl email.pl [email protected]
I am passing in "[email protected]" as command line argument to that script. This is my Python script:
import subprocess
pipe = subprocess.Popen(["perl","./email.pl"])
print pipe
This works fine. But if I pass arguments it throws file not found:
import subprocess
pipe = subprocess.Popen(["perl","./email.pl moun"])
print pipe
Error:
<subprocess.Popen object at 0x7ff7854d6550>
Can't open perl script "./email.pl moun": No such file or directory
How can I pass command line arguments in this case?