Using perl in python
claird at Starbase.NeoSoft.COM
Thu Jun 10 14:07:41 CEST 1999
In article <6cs73.2432$nn.739920 at news.shore.net>,
Michael P. Reilly <arcege at shore.net> wrote:
>Brenda <bbailey08 at my-deja.com> wrote:
>: I have a bunch of perl libraries that I would like to call in my python
>: scripts. Is this possible?
>It is possible; Tkinter utilizes an embedded Tk interpreter. You
>would have to write a Perl interpreter. There may be some people
>around who might help you with that. I'm in the middle of embedding
>another interpreter myself.
>I've found that it is more efficient (and more fun) to convert the
>libraries to Python. The code is invariably clearer.
There's an even grosser approach that I've semi-automated.
I build Perl scripts as strings from within Python, and
send them out to an external (Perl) process for execution.
The automation part is that I have conventions for expressing
variable references so I can get data to flow conveniently
back and forth. It's only "semi-", 'cause I tinker with
exception-handling and such most times I use it.
When do I use it? Typically, when CPAN has something I
want in Python. I do a cognate translation of the CPAN
interface into Python, and steal the implementation from our
Perl colleagues. When it becomes important enough, or I
make time for fun, I rewrite the implementation in Python.
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird at NeoSoft.com +1 281 996 8546 FAX
More information about the Python-list