Movatterモバイル変換


[0]ホーム

URL:


View on Github
HomeNewsDownload
InstallationJavaDocAPIdia (alternative to JavaDoc)Python 2.7Jython BookWikiArchived Sites
Bug trackerGithubLegacyMailing ListDeveloper GuideJython 3 Features (MVP)Jython 3 RoadmapJython 3 (snapshot) on APIdiaWebsite source
Links

What is Jython?

The Jython project provides implementations ofPython inJava,providing to Python the benefits of running on the JVM and access to classes written in Java.The current release (a Jython 2.7.x) only supports Python 2 (sorry).There is work towards a Python 3 in the project’s GitHub repository.

Jython implementations are freely available for both commercial and non-commercial use.They are distributed with source code under thePSF License v2.

Jython is complementary to Java and is especially suited for the following tasks:

Here is an example of running Python code inside a simple Java application
importorg.python.util.PythonInterpreter;publicclassJythonHelloWorld{publicstaticvoidmain(String[]args){try(PythonInterpreterpyInterp=newPythonInterpreter()){pyInterp.exec("print('Hello Python World!')");}}}
Here is an example of using Java from Python code
fromjava.langimportSystem# Java importprint('Running on Java version: '+System.getProperty('java.version'))print('Unix time from Java: '+str(System.currentTimeMillis()))

Getting Started

Ready to get started? Head over toDownloads.

Or you could read a quick overview offeatures specific to Jython.

A more detailed introduction and reference can be found in theJython Book.

Who uses Jython?

Jython is embedded in lots of projects. See some fromMVNRepository


[8]ページ先頭

©2009-2026 Movatter.jp