Skip to content

Commit 0a0a7e4

Browse files
author
Troy Melhase
committed
Added readme.
1 parent 1fc13e2 commit 0a0a7e4

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Simple but effective tool to translate Java source code into Python.
2+
3+
Here's a quick example. First, the Java source:
4+
5+
6+
$ cat HelloWorldApp.java
7+
class HelloWorldApp {
8+
public static void main(String[] args) {
9+
System.out.println('Hello, world.');
10+
System.out.println(args);
11+
}
12+
}
13+
14+
Next, we translate:
15+
16+
$ j2py -i HelloWorldApp.java
17+
#!/usr/bin/env python
18+
# -*- coding: utf-8 -*-
19+
20+
class HelloWorldApp(object):
21+
''' generated source for HelloWorldApp
22+
23+
'''
24+
@classmethod
25+
def main(cls, args):
26+
print 'Hello, world.'
27+
print args
28+
29+
if __name__ == '__main__':
30+
import sys
31+
HelloWorldApp.main(sys.argv)
32+

0 commit comments

Comments
 (0)