On Tuesday, May 7, 2013 12:43:43 PM UTC-7, Mike S wrote: > > > On Tuesday, May 7, 2013 2:55:28 PM UTC-4, kcrisman wrote: >> >> >>> Anyway, I'm still having problems. This time I got a long stack trace >>> in the middle of the build, and then it seemed to continue until stalling >>> after the lines, >>> [tensor ] loading cross citations... looking for now-outdated files... >>> none found >>> [tensor ] no targets are out of date. >>> [history_a] loading cross citations... looking for now-outdated files... >>> none found >>> [history_a] no targets are out of date. >>> >> >> Luckily, Sage should still function normally (this is just building >> documentation). Does it, or is this attached log file what happens when >> you try to run Sage? >> > > I just checked, and Sage does run, but I'm having problems, and I'm not > sure if it's just my own ignorance or not. > > If I run "./sage" and write "is_prime(2^32)" interpreter, it works. > However, if I copy/paste a block of code from sagenb.org, the interpreter > goes haywire. > If I run "./sage filename," it loads the file and tries to interpret it, > but I get errors like "global name 'is_prime' is not defined." >
This should depend on what "filename" is. If "filename" does not end in ".sage", then you will get these errors: Sage treats such files as plain Python files, and so you need to import any code you need manually, for example by adding a line like "from sage.all import *" at the top. However, if "filename" ends in ".sage", Sage should take care of the importing for you, and it should work. -- John > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.