I need to somehow use a python script in a perl program. I don't know python, so I cannot write the entire thing in python. But, I want to use a python script that was written by someone else.
Or, similar to brutaldev's suggestion, call it with backticks to read the output of the Python script.
my $s = `myscript.py foo bar`;
print "Script returned $s";
ambuli
ASKER
Thank you very much. One small question. The system call does not take $inputfile as an argument to the script. Also, I had to remove the " " around $Python $PyScript.
What could be wrong.
...
foreach $inputfile (@inputfiles)
{
chomp($inputfile);
system($Python $PyScript, $inputfile ) == 0 or die "Could not execute script.";
}
ambuli
ASKER
If the argument is filenameone, it should be passed as it is. Not "filenameone".
my $s = `myscript.py foo bar`;
print "Script returned $s";