jython 2.5无法打印字符串 [英] jython 2.5 can't print string

查看:84
本文介绍了jython 2.5无法打印字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_20
Type "help", "copyright", "credits" or "license" for more information.
>>> print 3
3
>>> print "3"
...

我尝试了Jython 2.2.1版,没关系,但是问题仍然存在于Jython 2.7b1版中:

Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_39
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'ab'
...

解决方案

也许这是特定于OS或计算机环境的,因为它在2.7.0中的Windows上对我有效,并且在以前的版本中已看到.

>

Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_51
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.platform()
'Java-1.7.0_51-Java_HotSpot-TM-_64-Bit_Server_VM,_24.51-b03,_Oracle_Corporation-on-Windows_7-6.1-amd64'
>>> print 3
3
>>> print '3'
3
>>> print "3"
3

什么是基础操作系统,如何调用控制台?除了print以外的其他构造或在不引用带引号的字符串时,您是否有问题?

Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_20
Type "help", "copyright", "credits" or "license" for more information.
>>> print 3
3
>>> print "3"
...

I tried version Jython 2.2.1, it was ok, but the problem remains in version Jython 2.7b1:

Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_39
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'ab'
...

解决方案

Perhaps this is specific to the OS or machine environment, as it behaves for me on windows in 2.7.0 and have seen it behave in previous versions.

Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_51
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.platform()
'Java-1.7.0_51-Java_HotSpot-TM-_64-Bit_Server_VM,_24.51-b03,_Oracle_Corporation-on-Windows_7-6.1-amd64'
>>> print 3
3
>>> print '3'
3
>>> print "3"
3

What is the underlying OS and how are you invoking the console? Do you have the problem with constructs other than print or when not referencing a quoted string?

这篇关于jython 2.5无法打印字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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