What are the additional capabilities provided by Python when used with Java?

I am a Java developer. I would like to know what features and / or positives I can add to a Java application by including Python as a development language.

I am posting this here as I am not getting a good answer from google. I would ask you not to vote, marking it as a descriptive question so that a future Java developer can understand how he can improve the application with Python.


source to share

3 answers

In general, there are no (general) benefits to this. You simply add your own set of run-time functions to the other language, which for the most part does what you can do in Java. Unless you have a particular reason to add Python integration to your Java application, it would be a very bad idea to do so.

However, in some cases, there are reasons why you might want to do this:

To add scripting capabilities to your application.
If you want the end users of your application (or perhaps add-on authors or sysadmins) to be able to script parts of your application, then Python is a smart choice to suggest. There are other good options out there, but Python is pretty well known, quite mature, has decent Java integration and a good feature set, so it's not a bad choice.

To Place Python Developers on Your Team
If you have Python developers on your team who (for whatever reason) do not want / cannot write in Java, then you can provide support tools, including their code, in your Java application.

If you think writing Python is more productive
If you / your team thinks writing Python code is more productive than writing Java code to justify the cost of integrating the Jython runtime into your Java application, you can take this route. Personally, I would question this solution most of the time in most use cases, but it depends on each command.

To integrate with existing Python code
There may be libraries or tools written in Python that you want to integrate with in your application. Instead of rewriting them in Java or trying to run them through the command line, it would be nice to run them in a Jython environment in the JVM.

Unless you have a specific reason, such as one of the above, then simply integrating Jython into your application will not bring you any benefit, it will just be an extra effort to write and maintain. If you have one of these reasons, then it may make sense, it will depend on your circumstances.



I know how to use python with java via jython, but back ... try asking your question to the jython community.



1st: jython is many times slower than java.
2nd: As I remember, the integration towards jython -> java is not very unemotional.
3rd: you get python syntax, maybe some batteries (I don't know that). This is a plus.
4th: you get nice multithreading support in python instead of green thread and GIL. This can be a plus.



All Articles