You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Jython is a [Java](https://go.java/index.html) implementation of [Python](https:
8
8
* 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.
9
9
* 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.
10
10
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
12
12
```java
13
13
importorg.python.util.PythonInterpreter;
14
14
@@ -20,6 +20,14 @@ public class JythonHelloWorld {
20
20
}
21
21
}
22
22
```
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
+
23
31
Ready to get started? Head over to [Downloads](download)
0 commit comments