[IPython-user] Ipython and Jython 2.50b

Ondrej Certik ondrej@certik...
Thu Nov 13 08:36:31 CST 2008


On Wed, Nov 12, 2008 at 8:56 PM, Fernando Perez <fperez.net@gmail.com> wrote:
> On Wed, Nov 12, 2008 at 11:49 AM, Ville M. Vainio <vivainio@gmail.com> wrote:
>> On Wed, Nov 12, 2008 at 9:27 PM, Phyo Arkar <phyo.arkarlwin@gmail.com> wrote:
>>
>>> ImportError: No module named signal
>>>
>>> Is there any work around or , how can i use iptyhon with jython?
>>
>> signal is easy (because it's not really needed). However, readline is
>> a more probably deal breaker, but not necessarily:
>>
>> http://wiki.python.org/jython/ReadlineSetup
>
> A few years ago some of the jython guys in Boulder tried to get this
> to work at an ipython sprint, but at the time it was a royal nightmare
> and they didn't really get very far.  But jython has made a LOT of
> progress since, so it would be great if you could keep us posted on
> your progress with this.
>
> Once you get readline working, you may need to work aroun
> sys._getframe, which I think is also missing from Jython (I could be
> wrong) and is used in a lot of places:

Well, I think you are wrong. :)

$ jython
Jython 2.5a3+ (unknown:exported, Nov 12 2008, 11:38:34)
[OpenJDK Server VM (Sun Microsystems Inc.)] on java1.6.0_0
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._getframe
<bound method systemstate._getframe of <module 'sys' (built-in)>>


and btw, jython now runs sympy:

$ jython
Jython 2.5a3+ (unknown:exported, Nov 12 2008, 11:38:34)
[OpenJDK Server VM (Sun Microsystems Inc.)] on java1.6.0_0
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
>>> x = Symbol("x")
>>> limit(sin(x)/x, x, 0)
1
>>> integrate(x**2 * sin(x), x)
2*cos(x) - x**2*cos(x) + 2*x*sin(x)
>>>

The last minor issue still missing in jython is a compatible "ast"
module (Frank and other jython developers are working on this), but
apart from that, all sympy tests seem to run. Given that openjdk is
now in Debian main, we seem to have another working opensource Python
implementation soon.

Ondrej


More information about the IPython-user mailing list