33Simple but effective tool to translate Java source code into Python.
44
55
6+ The java2python package can translate any syntactically valid Java source code
7+ file. The generated Python code is not guaranteed to run, nor is guaranteed to
8+ be syntactically valid Python. However, java2python works well many cases, and
9+ in some of those, it creates perfectly usable and workable Python code.
10+
611There are [ lots of docs] [ ] , [ plenty of tests] [ ] , and [ many options] [ ] for
712controlling code generation.
813
9- I'm in the process of finalizing the documentation and packaging a release.
10- That will be release 0.5 when it's done. If you're looking for old releases,
11- check the [ downloads] [ ] link above.
14+ If you're looking for old releases, check the [ downloads] [ ] link above.
1215
13- Here's a very simple example. First we show the file :
16+ Here's a very simple example:
1417
1518``` bash
1619$ cat HelloWorld.java
1720```
18-
19- And we get this:
20-
2121``` java
2222// This is the HelloWorld class with a single method.
2323class HelloWorld {
@@ -33,24 +33,17 @@ Next we run our program:
3333``` bash
3434$ j2py HelloWorld.java
3535```
36-
37- And we get this:
38-
3936``` python
4037# !/usr/bin/env python
41- """ generated source for module HelloWorld
38+ """ generated source for module HelloWorld """
4239
43- """
4440# This is the HelloWorld class with a single method.
4541class HelloWorld (object ):
46- """ generated source for class HelloWorld
42+ """ generated source for class HelloWorld """
4743
48- """
4944 @ classmethod
5045 def main (cls , args ):
51- """ generated source for method main
52-
53- """
46+ """ generated source for method main """
5447 print " Hello, world."
5548
5649if __name__ == ' __main__' :
0 commit comments