[IPython-dev] Namespace pollution and a kernel panel

MinRK benjaminrk@gmail....
Fri Jun 15 20:32:18 CDT 2012


On Fri, Jun 15, 2012 at 5:24 PM, Bob McElrath <bob+ipython@mcelrath.org>wrote:

> Dumb question...but how?
>
> In any case I'm going to stop using --pylab, and use '%pylab inline'
> instead.
> The former makes the notebook not standalone -- it's dependent on whomever
> I
> send it to knowing to start ipython with the --pylab option.
>

Yes, this was an artifact of the fact that the %pylab magic didn't
initially work in the kernel, which has since been fixed.

Among other things, PR 1954
<https://github.com/ipython/ipython/pull/1954> removes
any recommendation for starting with `--pylab` from the example notebooks,
because it's really not the best way to do it.


>
> Fernando Perez [fperez.net@gmail.com] wrote:
> > On Fri, Jun 15, 2012 at 1:31 PM, Bob McElrath <bob+ipython@mcelrath.org>
> wrote:
> > > This is because I ran ipython --pylab, but it highlights a bigger
> problem: how
> > > does the user know which symbols are defined?
> >
> > This is slightly orthogonal to the rest of the discussion, but you can
> > configure ipython to *not* do 'from numpy import *' when --pylab is
> > given, and to only provide the names 'numpy, matplotlib, pyplot, np,
> > plt' in your namespace and nothing else.  That gives you the plotting
> > support (including backend integration and gui/inline support),
> > without any further pollution of the namespace.
> --
> Cheers, Bob McElrath
>
> "The individual has always had to struggle to keep from being overwhelmed
> by
> the tribe.  If you try it, you will be lonely often, and sometimes
> frightened.
> But no price is too high to pay for the privilege of owning yourself."
>    -- Friedrich Nietzsche
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20120615/ea3f1eae/attachment.html 


More information about the IPython-dev mailing list