perl script call python -linux
I have a perl script that is running in windows environment. This is calling python BodyTextExtractor.
My problem is: I have to move the script to run on linux and I have to change the following part of the script and I don't know how. Please help me!
$job = Win32::Job->new;
$job->spawn("C:\\Python24\\python.exe", "python BodyTextExtractor.py $PName.txt",
stdout => FILE_tmp2,
$status = $job->run(60);
Thanks a lot!
Just call the BodyText python script using the python interpreter.
#python BodyTextExtractor.py filename
If you really want to call a python script from perl, you could use something like this:
open(STDOUT, ">$PName") || die "Can't redirect stdout";
$status = system("python BodyTextExtractor.py $PName.txt");
Alternately, if you need better control on this subprocess, you might want to look at either IPC::Run3 or IPC::Run (see http://search.cpan.org/~rjbs/IPC-Run...b/IPC/Run3.pm).
Thank you for the answers.
You really help me a lot!
|All times are GMT -5. The time now is 09:42 AM.|