[IPython-dev] isympy doesn't work with the new ipython-dev

Brian Granger ellisonbg.net at gmail.com
Tue Feb 9 23:37:29 EST 2010


Erik,

This approach will also work.  With the current trunk, you shouldn't even
have
to move the ipython_config_sympy.py to .ipython.  But if you do move it
over,
you can change it to your taste.  Can you mention this on the sympy list to
see what approach they want to take?

Cheers,

Brian

I encountered some problems with isympy as well, but managed to get it
> to work (at least for my purposes) by changing /usr/local/bin/isympy
> (or wherever your script installs the isympy script) to just:
>
> #!/bin/bash
> ipython -p sympy
>
>
> and then I put a ipython_config_sympy.py file in the .ipython
> directory with the following:
>
>
> c = get_config()
>
> # This can be used at any point in a config file to load a sub config
> # and merge it into the current one.
> load_subconfig('ipython_config.py')
>
> lines = """
> from __future__ import division
> from sympy import *
> x, y, z = symbols('xyz')
> k, m, n = symbols('kmn', integer=True)
> f, g, h = map(Function, 'fgh')
> """
>
> # You have to make sure that attributes that are containers already
> # exist before using them.  Simple assigning a new list will override
> # all previous values.
> if hasattr(c.Global, 'exec_lines'):
>    c.Global.exec_lines.append(lines)
> else:
>    c.Global.exec_lines = [lines]
>
>
>
> On Fri, Jan 22, 2010 at 4:58 PM, Fernando Perez <fperez.net at gmail.com>
> wrote:
> > On Fri, Jan 22, 2010 at 1:20 PM, Gökhan Sever <gokhansever at gmail.com>
> wrote:
> >>
> >> I can't get the isympy working with the Fernando's trunk. I solved one
> of
> >> the missing attribute error but stuck at the other one:
> >
> > No, things have changed a bit.  I'm insanely pressed for time right
> > now, the best I suggest is looking at this test code file, around line
> > 130:
> >
> >
> http://bazaar.launchpad.net/%7Efdo.perez/ipython/trunk-dev/annotate/head%3A/IPython/testing/globalipapp.py#L130
> >
> >
> > That makes the kind of shell you're looking for, sort of.
> >
> > Sorry not to be able to give you a detailed example right now...
> >
> > cheers,
> >
> > f
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20100209/1eb17644/attachment.html>


More information about the IPython-dev mailing list