Suppose you have an application written in Java, and you want to enable
other applications or processes written in Python to communicate with
it, i.e., to use Python as a scripting language for the application.
On Windows you could do this with COM and various addons such as
J-Integra and Mark Hammond's libraries.
How would you do this if you want a mechanism that is portable across
Windows, Linux, Mac, and Unix?
Any ideas? Jython would be a natural candidate, but it is stuck at
Python 2.1 and seems to have an uncertain future.
Thanks in advance. 6 1671
"JKPeck" <JK****@gmail.com> writes: Suppose you have an application written in Java, and you want to enable other applications or processes written in Python to communicate with it, i.e., to use Python as a scripting language for the application. On Windows you could do this with COM and various addons such as J-Integra and Mark Hammond's libraries.
How would you do this if you want a mechanism that is portable across Windows, Linux, Mac, and Unix?
I suppose you could make some layer that sits between JNI and Python's
C API. It may be easier to use some slower IPC mechanism like
sockets, if you can tolerate that.
JKPeck wrote: Suppose you have an application written in Java, and you want to enable other applications or processes written in Python to communicate with it, i.e., to use Python as a scripting language for the application. On Windows you could do this with COM and various addons such as J-Integra and Mark Hammond's libraries.
How would you do this if you want a mechanism that is portable across Windows, Linux, Mac, and Unix?
Any ideas? Jython would be a natural candidate, but it is stuck at Python 2.1 and seems to have an uncertain future.
Jython 2.1 works great and there is (slow) progress being made in
modernizing it. I recommend it.
Kent
For most purposes Jython 2.1 is just fine. The lack of recent features
is not a show stopper. What do you need metaclasses? decorators? BTW,
there is Jython 2.2 as an alpha release.
There are a number of ways you can use Java code through Python.
Use JPype to start a Java VM http://jpype.sourceforge.net/
Or compile using GCJ and expose as a DLL/SO or better yet, make a SWIG
extension.
A good example for this is PyLucene.
Python/Java Wrapper Generator http://www.rexx.com/~dkuhlman/generate_wrappers.html
simplifies the process.
Or use some standard interop mechanism. Write an XMLRPC/SOAP/CORBA and
script via Python. This is similar to the COM approach.
Or maybe, you can look into XPCOM. I have no experience with it.
And finally a bit more perverse approach that I used once. Converted
Java bytecode to CIL with IKVM. http://www.ikvm.net/
And then I used Python for .NET
( http://www.zope.org/Members/Brian/PythonNet), a really well
implemented integration module if I ever saw one, to access the code.
Thanks for these suggestions. To be clear, we already have a Python
2.4 minimum requirement for other reasons, and we are looking for a
long-term solution so that as Python advances, the scripting solution
can keep up in a timely way.
Since the Java code is for a very large, complex application, we need
to bring Python to Java rather than Java to Python.
We will take a look at some of the other ideas.
JKPeck wrote: Suppose you have an application written in Java, and you want to enable other applications or processes written in Python to communicate with it, i.e., to use Python as a scripting language for the application. On Windows you could do this with COM and various addons such as J-Integra and Mark Hammond's libraries.
How would you do this if you want a mechanism that is portable across Windows, Linux, Mac, and Unix?
Any ideas? Jython would be a natural candidate, but it is stuck at Python 2.1 and seems to have an uncertain future.
JPype or CORBA/ICE.
Diez
"JKPeck" <JK****@gmail.com> writes: Suppose you have an application written in Java, and you want to enable other applications or processes written in Python to communicate with it, i.e., to use Python as a scripting language for the application. On Windows you could do this with COM and various addons such as J-Integra and Mark Hammond's libraries.
How would you do this if you want a mechanism that is portable across Windows, Linux, Mac, and Unix?
Any ideas? Jython would be a natural candidate, but it is stuck at Python 2.1 and seems to have an uncertain future.
Thanks in advance.
If you need real CPython (e.g., need add-on libraries compiled in C),
then XMLRPC is a clean way to make the connection. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dave Brueck |
last post by:
Below is some information I collected from a *small* project in which I wrote
a Python version of a Java application. I share this info only as a data
point (rather than trying to say this data...
|
by: bezeee |
last post by:
At my work we are in the process of building a tool to test an XML based
API. Basically, XML in and XML out over http. Currently, there are two
engines that do all of the schema validations, xml...
|
by: Jon Perez |
last post by:
Can one run a 1.5 .pyc file with the 2.x version
interpreters and vice versa?
How about running a 2.x .pyc using a 2.y interpreter?
|
by: Wolfgang Keller |
last post by:
Hello,
as a non-developer I am currently participating in an industrial "research"
project to develop a so-called "web application". This application serves
at the same time as middleware to...
|
by: Maurice LING |
last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic
typing, is there any other real reasons that Python is slower than Java?
maurice
|
by: john67 |
last post by:
The company I work for is about to embark on developing a commercial
application that will cost us tens-of-millions to develop. When all is
said and done it will have thousands of business...
|
by: Hal Vaughan |
last post by:
I'm self taught and most of what I've been working on for the past several
years has been entirely in Perl and Java. I've noticed that I can code
about 5 times faster in Perl than Java, in part...
|
by: Stuart Turner |
last post by:
Hi Everyone,
I'm working hard trying to get Python 'accepted' in the organisation I work
for. I'm making some good in-roads. One chap sent me the text below on
his views of Python. I wondered...
|
by: abhinav |
last post by:
Hello guys,
I am a novice in python.I have to implement a full fledged mail server
..But i am not able to choose the language.Should i go for C(socket API)
or python for this project? What are the...
|
by: MilkmanDan |
last post by:
I'll be a college freshman this fall, attending Florida Institute of
Tech studying electrical engineering.
I was considering taking some classes in programming and computer
science, and I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |