After digging around a little bit more I found something that works. To load a python program into a worksheet, one can use
load "filename.py" assuming your code is stored in the file with name filename.py. Certainly you may need to specify the path where you save filename.py To compile and then load a Python or C program to a notebook, one can cython(open("home/sage/.sage/filename.spyx").read()) here assuming the file with name filename.spyx is located at the directory home/sage/.sage/ note that filename.spyx can contain code in either C or python. The SAGE tutorial describes the use of load and the use of cython(open(...)) was discussed in this group under the title Problem to access C code On Apr 25, 8:29 am, pong <[EMAIL PROTECTED]> wrote: > I have followed the SAGE program guide and create the function > sumsquares (one of the examples there). It works for the same session > of the notebook. My question is how can I use this faster version of > sumsquares in the future? > > At the moment, I just want when I type, e.g. sumsquares(1000), in a > notebook cell, SAGE will run the complied code that was created. > > I looked around from the reference manual and find something like > sage.server.support.cython_import... but it asks for a .pyx file. I > couldn't locate where it is. All I see are a .c and a .pyx.html files. > > Please help > Thanks in advance --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---