Jython:如何使用文件"jython-2.7-b1.jar" [英] Jython: How to use the file "jython-2.7-b1.jar"

查看:140
本文介绍了Jython:如何使用文件"jython-2.7-b1.jar"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Jython的新手.我从此处 http://www.jython.org/downloads.html 下载了jar文件

I am new to Jython. I downloaded a jar file from here http://www.jython.org/downloads.html

下载Jython 2.7beta1-jython.jar安装程序:独立版本,不包含捆绑的python文件.

Download Jython 2.7beta1 - jython.jar Installer : Standalone version without the bundled python files.

运行时:

$ java -jar jython-2.7-b1.jar 
Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_33
>>> print "hello"
... 

我没有得到回显的字符串"hello",而是得到了"...".

I didn't get echoed string "hello", instead I got "...".

我想这里的重点是这个jar中缺少的捆绑的python文件" .

I guess the point here is what are the "bundled python files" those are missed from this jar.

推荐答案

捆绑的python文件"是在Jython安装的Lib文件夹中找到的Python标准库模块(例如os.py).

The "bundled python files" are Python standard library modules (such as os.py) found in the Lib folder of a Jython installation.

以独立模式运行Jython时,所有内容(包括捆绑的Python文件)都打包在一个jar文件中. Jython 2.7的当前版本是 jython-standalone-2.7-b1.jar .使用此jar文件时,我看不到问题中显示的奇怪行为.简单的print语句有效:

When running Jython in standalone mode, everything -- including the bundled Python files -- is packaged in a single jar file. The current release for Jython 2.7 is jython-standalone-2.7-b1.jar. When using this jar file, I do not see the strange behaviour shown in the question. The simple print statement works:

$ java -jar jython-standalone-2.7-b1.jar
Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)
[Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.7.0_03
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello"
hello
>>>

jython-2.7-b1.jar 文件是独立Jython的变体,不包含捆绑的Python文件.我不知道为什么有人要使用它.我还没有找到任何文档说明为什么要单独下载该文档,请访问 http://www.jython.org/downloads.html .

The jython-2.7-b1.jar file is a variant of standalone Jython that does not include the bundled Python files. I don't know why anyone would want to use it. I haven't been able to find any documentation that explains why it is provided as a separate download at http://www.jython.org/downloads.html.

这篇关于Jython:如何使用文件"jython-2.7-b1.jar"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆