Re: Integration with java (Jpype vs. JPE)
Istvan Albert wrote: Steve Menard wrote: To asnwer your question more fully, the jpype-specific cide is only for looking up the Classes and startting/stopping the environment. For everything else, Java objects and classes are used as regular Python objects. Thanks for the response. Currently I don't need to use java but in the past when I explored such a possibility I looked at jpype and I was unable to understand from the documentation what it actually does. There is a lot of text there, but it is all concerning catching errors or other subtleties. For a new visitor the most important question is about how it works, what does it do, and how can it be applied for the given problem. > everything else, Java objects and classes are used as regular Python > objects. This is too generic. My question was a little more specific, how would I pass a python list as an argument of a java class/method or transform a java list into a python one? You don't have to answer it here, I'm just pointing out the kind of questions that I was unable to get an answer for on the jpype website. best, Istvan. I see what you mean. And I agree fully. I guess that's one more thing to put on the TODO list hehe. Thanks for the input. Steve -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Joachim Boomberschloss wrote: Option iii would also enable writing independent packages in Python and Java, but its glue layer will be distributed between Python and Java using Jython and Pyro (I chose Pyro because it works in both CPython and Jython, and can be used to communicate between them). Please note that currently it is not possible to use Pyro as a server in Jython. Only as a client. Also; last time I checked there were some bugs in the Jython compiler that were triggered by Pyro's code (parts of it would give a compile error). See http://www.razorvine.net/python/PyroAndJython --Irmen -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Thanks for the info. I understand now the background and possibilities, but would like to refine my query: As I see it, writing a hybrid Java/Python application faces approximately three possibilities: (i) write the core in Java and do some scripting with Jython, (ii) write independent code in Java and in Python, and integrate using JPype (or similar), using Python also as a glue layer, (iii) write independent code in Java and in Python, and integrate using a neutral technology. Since much of the code in my project is already written, I am considering options ii and iii. This is how I perceive the work required in each case: Option ii would enable writing independent packages in Python and Java, and will require a glue layer in Python consisting of general administration and wrappers around Java packages written using JPype. I don't yet have a clear perception of how difficult it would be to make such wrappers, or to put my faith in JPype at this stage. Option iii would also enable writing independent packages in Python and Java, but its glue layer will be distributed between Python and Java using Jython and Pyro (I chose Pyro because it works in both CPython and Jython, and can be used to communicate between them). This would (to the best of my understanding) enable a smoother interface between Java and Python, but will probably complicate somewhat the glue layer, both because it would use networking to communicate, and because it would probably involve taking special measures to overcome the differences between CPython and Jython (since the glue layer will need to run on both of them). Joe. --- Cameron Laird <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Jon Perez <[EMAIL PROTECTED]> wrote: > >Can someone summarize in a nutshell what is the > >difference between JPype and JPE? > > JPE's the original. It provided more functionality > than JPype has > achieved so far, I believe (though that could change > any day). I > think no one now maintains JPE. > > Someone really ought to include a couple of > sentences to that effect > on the front page of http://jpype.sf.net/ >. > -- > http://mail.python.org/mailman/listinfo/python-list > __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Steve Menard wrote: To asnwer your question more fully, the jpype-specific cide is only for looking up the Classes and startting/stopping the environment. For everything else, Java objects and classes are used as regular Python objects. Thanks for the response. Currently I don't need to use java but in the past when I explored such a possibility I looked at jpype and I was unable to understand from the documentation what it actually does. There is a lot of text there, but it is all concerning catching errors or other subtleties. For a new visitor the most important question is about how it works, what does it do, and how can it be applied for the given problem. > everything else, Java objects and classes are used as regular Python > objects. This is too generic. My question was a little more specific, how would I pass a python list as an argument of a java class/method or transform a java list into a python one? You don't have to answer it here, I'm just pointing out the kind of questions that I was unable to get an answer for on the jpype website. best, Istvan. -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Istvan Albert wrote: Cameron Laird wrote: Someone really ought to include a couple of sentences to that effect on the front page of http://jpype.sf.net/ >. Now I remember visiting this site, but never understood how it actually worked. Examples such as: from jpype import * startJVM("d:/tools/j2sdk/jre/bin/client/jvm.dll", "-ea") java.lang.System.out.println("hello world") shutdownJVM() in three different versions are the only code examples that to show "complete" working snippets. I'm still clueless as to how would one say share a list between python and java. Istvan. I am sorry you find the site so confusing ... perhpas I shold post a more complete example in a prominent location ... To asnwer your question more fully, the jpype-specific cide is only for looking up the Classes and startting/stopping the environment. For everything else, Java objects and classes are used as regular Python objects. In version 0.4.x, the API mostly remain Java's. This means some of the basic magic python methods have been mapped to java equivalent (like __str__ mapped to toString() and __eq__ mapped to equals()). If you have any questions, feel free to post them on the feedback list on sourceforge. I check it every day and I try to answer as quickly as possible. Steve, aka devilwolf on sourceforge, maintainer of JPype -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Istvan Albert wrote: Now I remember visiting this site, but never understood how it actually worked. Examples such as: from jpype import * startJVM("d:/tools/j2sdk/jre/bin/client/jvm.dll", "-ea") java.lang.System.out.println("hello world") shutdownJVM() in three different versions are the only code examples that to show "complete" working snippets. I'm still clueless as to how would one say share a list between python and java. A while ago there was a thread in c.l.p about using JPype to access JMS from within Python. IIRC someone then contributed a more elaborate real life example of how to do this. Search Google Groups for more details. Regards, Jan -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Cameron Laird wrote: Someone really ought to include a couple of sentences to that effect on the front page of http://jpype.sf.net/ >. Now I remember visiting this site, but never understood how it actually worked. Examples such as: from jpype import * startJVM("d:/tools/j2sdk/jre/bin/client/jvm.dll", "-ea") java.lang.System.out.println("hello world") shutdownJVM() in three different versions are the only code examples that to show "complete" working snippets. I'm still clueless as to how would one say share a list between python and java. Istvan. -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Cameron Laird wrote: In article <[EMAIL PROTECTED]>, Jon Perez <[EMAIL PROTECTED]> wrote: Can someone summarize in a nutshell what is the difference between JPype and JPE? JPE's the original. It provided more functionality than JPype has achieved so far, I believe (though that could change any day). I think no one now maintains JPE. Someone really ought to include a couple of sentences to that effect on the front page of http://jpype.sf.net/ >. Well, Cameron summed it up pretty good :) I'd add that The only major (and yes I know it is VERY major) funtionailty missing in JPype is the ability to subclass Java classes in Python. On the other hand JPype will (soon) have functionality that JPE doesnt have. Java arrays can already (in 0.4) be iterated as regular Python collections. Version 0.5 will add that same behavior for Java collections (Map, List, Set, Iterator). Of course, the above is based on the JPE documentation, because I havent been able to get JPE to work. About Cameron's suggestion, sure. I'll do it as soon as I (or someone else) can get both JPype and JPE to work so they can be compared through more than just their respective documentation. Steve a.k.a devilwolf on sourceforge -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
In article <[EMAIL PROTECTED]>, Jon Perez <[EMAIL PROTECTED]> wrote: >Can someone summarize in a nutshell what is the >difference between JPype and JPE? JPE's the original. It provided more functionality than JPype has achieved so far, I believe (though that could change any day). I think no one now maintains JPE. Someone really ought to include a couple of sentences to that effect on the front page of http://jpype.sf.net/ >. -- http://mail.python.org/mailman/listinfo/python-list
Re: Integration with java (Jpype vs. JPE)
Can someone summarize in a nutshell what is the difference between JPype and JPE? -- http://mail.python.org/mailman/listinfo/python-list