From: Kevin J. Butler <jython-kbutler@sa...> - 2002-12-11 16:26:35
> From: Luis Fernando Hachich de Souza <lsouza2@...>
> Perhaps this question can be related to a Python list, but anyway, the
> question is: Is there any way to call a Jython script from a Python
> We have here a system API written in Java and unfortunattely the tool we
> use to automate and to test the Java API only supports Python. The goal
> is to use that tool that only supports Python to call our Jython scripts
> to access tha Java API.
> I was thinking about using os.system to call the jython script directly
> from the os prompt, but I haven't test it yet.
os.system or os.popen are probably the easiest ways. However, doing
this will incur the rather large Java-Jython startup overhead for each
script you call (you can reduce it w/ a -S).
Other options include something like jpe (http://jpe.sf.net) which lets
you call Java APIs from CPython or an IPC mechanism (possibly just using
one of the popen variants to send multiple commands to the jython process).