On 12/07/15 12:02, Laura Creighton wrote:
In a message of Sun, 12 Jul 2015 12:46:15 +0200, Laura Creighton writes:
If you want
to use a library and it is written in Java, usually -- not all of the
time, but most of the time -- you can wrap it very easily, import it,
and it works.
I mispoke here. Most of the time you don't even have to wrap your
java libraries. They just work.
So this is the main reason for using Jython at all -- I want to use
these very nice java libraries, but I don't want to program in Java,
but in Python.
I'll just add slightly to that. I used to use Pyton in my days as an
architect because our development teams wrote their code in Java. I
could fire up Jython and just import a new library and use the
interactive prompt to test the new code. That was cool.
But there's another trick which is that Jython also has a compiler
so you can write a class in Python test it interactively, then
compile it so that it looks to Java like a native Java class and
Java code an use it. As an architect I could prototype ideas in
Python, and give the code for the Java guys to use. Once they
were happy they recoded it in native Java. Even more cool!
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor