Thank you very much, that was a great help. Is there a way to pickle user defined types? So that I can, say, email my advisor files containing the sage objects.
On Mar 10, 11:25 am, William Stein <wst...@gmail.com> wrote: > On Wed, Mar 10, 2010 at 11:17 AM, D. Monarres <dmmonar...@gmail.com> wrote: > > Hello all, > > > I am using a sage notebook interact to generate and display some > > random graphs (more specifically a self-created extension of the > > graph class with extra properties) and would like to have the chance > > to save the output. Usually the notebook makes all defined variables > > global and I can specifically save certain results, but since I have > > defined my interact as a function all of the objects created seem to > > be local and disappear when the interact is finished. (other than for > > the graph output) I have tried to pickle the objects and save to a > > file but sage doesn't seem to allow me to pickle self defined classes. > > I was wondering if there was a standard way that people work around > > this. Thank you in advance for your help, sage is a wonderful piece of > > software. > > > David Monarres > > This is easy. Just use the "global" keyword in Python. Here's an example: > > http://sagenb.org/home/pub/1757/ > > William > > > > > -- > > To post to this group, send email to sage-support@googlegroups.com > > To unsubscribe from this group, send email to > > sage-support+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/sage-support > > URL:http://www.sagemath.org > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org