Jython interp. problem.
I originally sent a question about this to debian-java, guess maybe I
should've asked here.
I have "jdk1.1" and "jython" packages installed. Curiously, when I run the
Jython interpreter interactively it doesn't accept indentation (which makes
it nearly useless for Python, as you might imagine!). It works fine when
interpreting a script.
Perhaps related to this, it is impossible to type a tab character
interactively (although I can type spaces).
Let me illustrate the two cases:
Running a script (normal):
peregrin:~/Learn> cat sample.py
def spam():
print 'spam'
spam()
peregrin:~/Learn> jython sample.py
spam
Same code, typed in interactively:
peregrin:~/Learn> jython
Jython 2.1 on java1.1.8 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> def spam():
... print 'spam'
...
Traceback (innermost last):
(no code object) at line 0
File "<console>", line 3
null
^
SyntaxError: invalid syntax
>>>
Anybody have an idea what this is about? Needless to say, I have tested the
exact same code in C Python, and it works as I expected it to. I have also
used Jython compiled from the upstream source. I figure it has to be
something to do with the Debian packaging (and perhaps the choice of Java
environment to run on). This is in the Debian 3.0r0 "Woody" distribution.
Thanks for any ideas,
Terry
--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com
Reply to: