Thanks: saving the code as a .spyx file was working perfectly as well. I am currently running some computations as a project for my master's thesis... The code is quite long by now (primality proving after Goldwasser-Kilian/ Atkin-Morain in Cython), but nevertheless I'll try to come up with an example by the end of this week (I will contribute the code soon anyways)
On 12 Dez., 22:43, Mitesh Patel <qed...@gmail.com> wrote: > On 12/11/2010 07:18 AM, Jeroen Demeyer wrote: > > > On 2010-12-11 14:10, G Hahn wrote: > >> Thanks for the link and your help! If avoiding the preparser just > >> consists in putting a "%python" in the first line and starting the > >> timing from another cell, then I already did that. But still the > >> notebook is quite slow in my opinion. > > Could you give us a smallish example, based on your code, that runs much > more slowly in the notebook than on the command line? > > >> Instead, I saved the code as a .py file and loaded it via "load > >> file.py" in the shell. This seems to work fine. But nevertheless my > >> original code was supposed to be in Cython (i.e. first line is > >> %cython) and was compiled by the notebook when pressing ALT+ENTER. Now > >> that I use the shell and a .py file, the first line "%cython" in front > >> of the actual code apparently doesn't work any more. Is it possible to > >> save the "_spyx.c" files generated by the notebook compiler and to > >> load them in the sage shell? > >> Thanks, > >> Georg > > > The notebook should never be substantially slower. Either you're doing > > something different in the shell and in the notebook, or you found a > > genuine bug. > > > If you want to load Cython code in the Sage shell, write your Cython > > code (without the %cython line) in a .spyx file and then load() that file. -- 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