python

G

George Mpouras

I am handled a Python script to re-use a part of it.
I have to options.
Modify Python script and and catch its STDOUT or write the whole code as
a Perl module.
Is there any other way to include Python code on a Perl script;
 
C

ccc31807

I am handled a Python script to re-use a part of it.

Have you tried writing a Perl script that calls the Python script?

Does the Python script return data values? Perhaps it writes to an output file that you can open and munge in Perl.

You can also try writing a shell script that (1) runs the Python script, (2) saves the output in a particular place, and (3) runs the Perl script thataccepts the output as input.

I find that Perl and Python are good at different things. Ideally, you should use the same language for the same task, just as a matter of sanity, rewriting as necessary in the language you choose. However, I don't object to having a process that uses different languages to handle different parts, and I have some processes that use Perl, ColdFusion, Visual Basic, and even Transact/SQL (Microsoft DTS) for different parts.

CC.
 
G

George Mpouras

Στις 20/9/2013 22:04, ο/η ccc31807 έγÏαψε:
Have you tried writing a Perl script that calls the Python script?

Does the Python script return data values? Perhaps it writes to an output file that you can open and munge in Perl.

You can also try writing a shell script that (1) runs the Python script, (2) saves the output in a particular place, and (3) runs the Perl script that accepts the output as input.

I find that Perl and Python are good at different things. Ideally, you should use the same language for the same task, just as a matter of sanity, rewriting as necessary in the language you choose. However, I don't object to having a process that uses different languages to handle different parts, and I have some processes that use Perl, ColdFusion, Visual Basic, and even Transact/SQL (Microsoft DTS) for different parts.

CC.



there is the Inline::python
too late now (i rewrite it to Perl) no one mention it , thanks ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top