kscript: Python APIs that I would like to make available in Perl, but I cannot find anything
This is sth. I did occassionally. The key is Inline-Python
together with a python version that has its headers and libs in place.
After installing the python-dev stuff (headers, libs) and installing
the Inline-Python per cpan-script or by hand,
you can do the following:
use strict;
use warnings;
say('Perl');
# - - - - - - - - - - - - - - - - - - #
use Inline Python => <<'MONTY'
def say(stuff):
print 'python says: ' + stuff
MONTY
# - - - - - - - - - - - - - - - - - - #
which prints here (Linux + Perl 5.8.8 + Py 2.5 + Inline::Python 0.22):
python says: Perl
(with a trailing newline ;-)
Regards
mwa | [reply] [Watch: Dir/Any] [d/l] |
Don't know how well it works with recent versions, but there's Inline::Python (last updated in 2005, hence the uncertainty). That'd at least be a starting point.
You might also consider exposing them via some sort of RPC mechanism (SOAP, XML-RPC, or what have you).
| [reply] [Watch: Dir/Any] |
Inline python does not work on Cygwin which is bad for me cuz I really need it here at work.
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |