X Tutup
Skip to content

Commit f86921d

Browse files
author
Troy Melhase
committed
Fixed up readme.
1 parent 80ece04 commit f86921d

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

.gitignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,34 @@ Simple but effective tool to translate Java source code into Python.
33
Here's a quick example. First, the Java source:
44

55

6-
$ cat HelloWorldApp.java
7-
class HelloWorldApp {
6+
$ cat HelloWorld.java
7+
// This is the HelloWorld class with it's single method.
8+
class HelloWorld {
89
public static void main(String[] args) {
9-
System.out.println('Hello, world.');
10-
System.out.println(args);
10+
System.out.println("Hello, world.");
1111
}
1212
}
1313

1414
Next, we translate:
1515

16-
$ j2py -i HelloWorldApp.java
16+
$ j2py HelloWorld.java
1717
#!/usr/bin/env python
18-
# -*- coding: utf-8 -*-
18+
""" generated source for module HelloWorld
1919

20-
class HelloWorldApp(object):
21-
''' generated source for HelloWorldApp
20+
"""
21+
# This is the HelloWorld class with it's single method.
22+
class HelloWorld(object):
23+
""" generated source for class HelloWorld
2224

23-
'''
25+
"""
2426
@classmethod
2527
def main(cls, args):
26-
print 'Hello, world.'
27-
print args
28+
""" generated source for method main
29+
30+
"""
31+
print "Hello, world."
32+
2833

2934
if __name__ == '__main__':
3035
import sys
31-
HelloWorldApp.main(sys.argv)
36+
HelloWorld.main(sys.argv)

0 commit comments

Comments
 (0)
X Tutup