Skip to content

Commit afd3541

Browse files
committed
Add Python example to the homepage
1 parent 7046933 commit afd3541

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Jython is a [Java](https://go.java/index.html) implementation of [Python](https:
88
* Interactive experimentation - Jython provides an interactive interpreter that can be used to interact with Java packages or with running Java applications. This allows programmers to experiment and debug any Java system using Jython.
99
* Rapid application development - Python programs are typically 2-10x shorter than the equivalent Java program. This translates directly to increased programmer productivity. The seamless interaction between Python and Java allows developers to freely mix the two languages both during development and in shipping products.
1010

11-
Here is an example of running Python code inside a simple Java application.
11+
##### Here is an example of running Python code inside a simple Java application
1212
```java
1313
import org.python.util.PythonInterpreter;
1414

@@ -20,6 +20,14 @@ public class JythonHelloWorld {
2020
}
2121
}
2222
```
23+
##### Here is an example of using Java from Python code
24+
```python
25+
from java.lang import System # Java import
26+
27+
print('Running on Java version: ' + System.getProperty('java.version'))
28+
print('Unix time from Java: ' + str(System.currentTimeMillis()))
29+
```
30+
2331
Ready to get started? Head over to [Downloads](download)
2432

2533
## Who uses Jython?

0 commit comments

Comments
 (0)