Java and Python -- each have their advantages and disadvantages. What is a programmer to do if he wants ease, efficiency, and power? Believe it or not, there is a solution -- a way to merge both languages and get the best of both worlds. Read on to find out how it works.
Currectly, the latest version is Jython 2.1. Download it and then move to the directory where it is installed. Next, open the file with your Java interpreter. For example:
The installation program will be presented to you, and installing it from there should be pretty straightforward. If you're using Jython 2.1 in conjunction with Java 1.4 or later, be sure to include the source in your installation. Move to the directory where you installed Jython and open up "org/python/core/Py.java" in your favorite text editor. Replace every appearance of "assert" with "a_ssert" and ever appearance of "enum" with "e_num". Do the same with "org/python/compiler/CodeCompiler.java" and "org/python/parser/PythonGrammar.java". Note that the latter will require you to replace "e_numeration" to "Enumeration" when you are done. Jython 2.1 uses the two terms, which were set as keywords in Java 1.4.
Once you're done, move to the directory where you installed Jython and start up the Jython interactive interpreter:
If everything has gone correctly, you should see something that looks a lot like the Python interactive interpreter. Let's test it out by executing some Python code: