niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » python
Using python code from Java?
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
Author Message
fortepianissimo
*nix forums beginner


Joined: 03 Feb 2005
Posts: 19

PostPosted: Thu Jul 20, 2006 5:36 pm    Post subject: Using python code from Java? Reply with quote

Is there a solution to enable Java programmers to call functions
written in Python? Any wrapper generator that wraps Python code into
some Java-callable form?

I briefly looked at Jython, but if I understand it right, it didn't
support full power of Python 2.3.x (which I need).

Any suggestion is welcome!
Back to top
Diez B. Roggisch
*nix forums Guru


Joined: 20 Feb 2005
Posts: 882

PostPosted: Thu Jul 20, 2006 5:51 pm    Post subject: Re: Using python code from Java? Reply with quote

fortepianissimo schrieb:
Quote:
Is there a solution to enable Java programmers to call functions
written in Python? Any wrapper generator that wraps Python code into
some Java-callable form?

I briefly looked at Jython, but if I understand it right, it didn't
support full power of Python 2.3.x (which I need).

Any suggestion is welcome!

CORBA or any other RPC mechanism supported by both python & Java springs
to mind.

Waiting for jython2.3 might be an option, too - things are pretty much
on the move right now.

Diez
Back to top
fortepianissimo
*nix forums beginner


Joined: 03 Feb 2005
Posts: 19

PostPosted: Thu Jul 20, 2006 5:55 pm    Post subject: Re: Using python code from Java? Reply with quote

Diez B. Roggisch wrote:
Quote:
fortepianissimo schrieb:
Is there a solution to enable Java programmers to call functions
written in Python? Any wrapper generator that wraps Python code into
some Java-callable form?

I briefly looked at Jython, but if I understand it right, it didn't
support full power of Python 2.3.x (which I need).

Any suggestion is welcome!

CORBA or any other RPC mechanism supported by both python & Java springs
to mind.

Thanks for the tip - but anything tighter than that? Dealing with
multiple servers within one application is a bit too much for my
project...

Quote:
Waiting for jython2.3 might be an option, too - things are pretty much
on the move right now.

Any idea how soon that will be?

Thanks!
Back to top
vatamane@gmail.com
*nix forums beginner


Joined: 01 Jul 2006
Posts: 43

PostPosted: Thu Jul 20, 2006 6:13 pm    Post subject: Re: Using python code from Java? Reply with quote

I can't think of any project that does that. Calling stuff from Java is
not easy to beging with you have to go through the native interface
(JNI) anyway.

I would suggest instead to create some kind of a protocol and let the
applications talk using an external channel (a FIFO pipe file, a socket
or just any network connection.) Usually when you go back and forth
between languages you don't really need a particular class object
(because class objects are quite different between languages) but what
you need is to have data passed back and forth and have both sides
interpret the data and process it. This sort of sounds like a protocol
and it is. Depending on how easy vs. extensible vs. comprehensible your
project is you could of course use XML RPC but that could get
complicated.

If you have extra time and desire you can of course contribute and
help bring Jython to 2.3, they can always use some help...

Nick V.


fortepianissimo wrote:
Quote:
Is there a solution to enable Java programmers to call functions
written in Python? Any wrapper generator that wraps Python code into
some Java-callable form?

I briefly looked at Jython, but if I understand it right, it didn't
support full power of Python 2.3.x (which I need).

Any suggestion is welcome!
Back to top
Ray
*nix forums beginner


Joined: 24 Mar 2005
Posts: 32

PostPosted: Fri Jul 21, 2006 1:33 am    Post subject: Re: Using python code from Java? Reply with quote

fortepianissimo wrote:
Quote:
Waiting for jython2.3 might be an option, too - things are pretty much
on the move right now.

Any idea how soon that will be?

If you just want to use Java to call Python, you can use Jython 2.1
too. Jython 2.2 is in (active) development right now, and hopefully a
beta will come out soon.



Quote:

Thanks!
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 7:50 pm | All times are GMT
navigation Forum index » Programming » python
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Python proficiency test Kent Johnson python 0 Fri Jul 21, 2006 10:47 am
No new posts Where is this code not freeing memory ? jithoosin C++ 2 Fri Jul 21, 2006 9:39 am
No new posts Where is this code not freeing memory ? jithoosin C++ 1 Fri Jul 21, 2006 9:27 am
No new posts Where is this code not freeing memory ? jithoosin C++ 1 Fri Jul 21, 2006 9:12 am
No new posts Where is this code not freeing memory ? jithoosin C++ 0 Fri Jul 21, 2006 9:09 am

Bad Credit Mortgages | Debt Consolidation | Online Advertising | Loans | Ringtones
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3277s ][ Queries: 16 (0.2304s) ][ GZIP on - Debug on ]