1
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' ... 
5
  • are you sure you haven't typed print '3" or print "3' (mismatched quotes)? Commented Dec 10, 2012 at 9:07
  • 1
    Please put a little effort into your question ... Commented Dec 10, 2012 at 9:08
  • Sorry. After some work, may be a bug for 2.5.2 Commented Jun 30, 2013 at 0:36
  • Maybe this answer will help: stackoverflow.com/a/17793767/407651. Commented Jul 24, 2013 at 11:55
  • @mzjn:I have tried the standalone version, my jre version is 1.6, the problem remains. Commented Jul 24, 2013 at 13:39

3 Answers 3

0

I tried this and my version works good:

Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:48:36) [Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.7.0_09 Type "help", "copyright", "credits" or "license" for more information. >>> print 3 3 >>> print "3" 3 

I use more recent versions of both Jython and Java, but I think this is not problem in your case. Try to save those print statements in print_test.py file and execute it via jython print_test.py and with CPython python print_test.py. Show us results.

Sign up to request clarification or add additional context in comments.

Comments

0

same problem here:

Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_02 Type "help", "copyright", "credits" or "license" for more information. >>> print 'hi' ... 

Looks like just a bug for 2.5.2

1 Comment

but problem remains in Jython 2.7b1
0

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?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.