On Wed, Dec 23, 2009 at 02:01:22PM -0800, William Stein wrote: > > I stumbled recently into a nifty feature of the IPython interpreter > > allowing for easy manipulations of the global namespace of the > > interpreter, at the python level. Thanks to it, one can now do: > > > > sage: S = SymmetricFunctions(ZZ) > > sage: S.import_shorthands() > > sage: s[1] + e[2] * p[1,1] + 2*h[3] + m[2,1] > > s[1] - 2*s[1, 1, 1] + s[1, 1, 1, 1] + s[2, 1] + 2*s[2, 1, 1] + s[2, 2] + > > 2*s[3] + s[3, 1] > > sage: s > > Symmetric Function Algebra over Integer Ring, Schur symmetric functions > > as basis > > sage: e > > Symmetric Function Algebra over Integer Ring, Elementary symmetric > > functions as basis > > ... > > What happens in the notebook (which in no way uses IPython)? Does it > at least fail gracefully?
Good point. I am using that seldom the notebook that I did not even think about it :-) Let me try ... Ok, as I expected, it's not that graceful: Traceback (click to the left for traceback) ... AttributeError: 'NoneType' object has no attribute 'to_user_ns' Is there an easy way to manipulate the global namespace for the notebook? For IPython, I am using: import IPython ip = IPython.ipapi.get() ip.to_user_ns( dict( ... ) ) Cheers, Nicolas -- Nicolas M. Thiéry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org