现实世界的 Jython 应用程序
我最近开始学习Python。尚未涉足编码领域。 在一次学习课程中,我遇到了 Jython 一词。
我用谷歌搜索了它&得到了一些信息。
我想知道是否有人使用 Jython 实现过任何实际程序。
I recently started learning Python. Not yet ventured into coding.
During one of my learning sessions, i came accross the term Jython.
I googled it & got some information.
I would like to know if anyone has implemented any real-world program using Jython.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
大多数时候,Jython 并不直接用于编写完整的读取世界程序,但许多程序实际上嵌入了 Jython 以将其用作脚本语言。
Jython 官方网站提供了项目列表,其中一些是用 Jython 编写的,另一些则使用 Jython 进行脚本编写:
http://wiki.python.org/jython/JythonUsers
Most of the time, Jython isn't used directly to write full read-world programs, but a lot of programs actually embed Jython to use it as a scripting language.
The official Jython website gives a list of projects, some written in Jython, others using Jython for scripting:
http://wiki.python.org/jython/JythonUsers
我目前正在 Jython 中编写完整的应用程序,并且强烈推荐它。拥有所有可供您使用的 Java 库非常方便,而且 Python 语法和语言功能实际上使使用其中一些库比在 Java 中更容易(我在这里主要谈论 Swing)。
查看Jython 书中有关 GUI 应用程序的章节。它进行了很多比较,例如“看看所有这些 Java 代码,现在看看它缩减为长度一半的 Python 代码!”。
我发现的唯一警告是:
I am writing a full application in Jython at the moment, and would highly recommend it. Having all of the Java libraries at your disposal is very handy, and the Python syntax and language features actually make using some of them easier than it is in Java (I'm mostly talking about Swing here).
Check out the chapter on GUI Applications from the Jython book. It does a lot of comparisons like 'Look at all this Java code, and now look at it reduced to Python code of half the length!'.
The only caveats I've found are:
Jython 在依赖注入方面确实很出色。
您知道必须为程序提供的那些讨厌的变量,例如
Jython 提供了一种通过将这些变量放入脚本中来注入这些变量的非常好的方法。它对于注入 java 依赖项也同样有效。
Jython really shines for dependency injection.
You know those pesky variables you have to give your program, like
Jython provides a really nice way of injecting those variables by putting them in a script. It works equally well for injecting java dependencies, as well.
WebSphere 和 WebLogic 将其用作默认脚本引擎以实现管理目的。
许多其他 Oracle 产品将其作为“oracle_commons”模块(Oracle Universal Installer、Oracle HTTP Server 等)的一部分提供。不过,目前部署的主要是 2.2 版本,该版本有点陈旧且笨重。
WebSphere and WebLogic use it as their default scripting engine for administrative purposes.
A lot of other Oracle products ship it as part of their "oracle_commons" module (Oracle Universal Installer, Oracle HTTP Server etc). It's mostly version 2.2 being deployed though, which is a bit old and clunky.
有一个使用 jython 的应用程序列表 http://wiki.python.org/jython/JythonUsers< /a>
There is a list of application that uses jython at http://wiki.python.org/jython/JythonUsers