Ask Your Question

fakaff's profile - activity

2019-09-15 17:51:56 +0100 received badge  Famous Question (source)
2015-06-03 04:28:24 +0100 received badge  Notable Question (source)
2013-10-18 13:39:47 +0100 received badge  Popular Question (source)
2012-03-21 20:16:17 +0100 commented answer Script stops working when imported to sage terminal ("plot" not defined)

That works here too. -- no reason in particular, just bugging me that it doesn't work and I might need it in the future.

2012-03-21 19:47:36 +0100 commented answer Script stops working when imported to sage terminal ("plot" not defined)

Now it's giving me error for using `^` instead of `**`. It seems to be completely ignoring the fact that it's sage code, not 100% python... even though I am inside the sage command line thingy and the exact same script works perfectly if I just copy in paste it.

2012-03-21 19:19:39 +0100 received badge  Editor (source)
2012-03-21 18:46:24 +0100 asked a question Script stops working when imported to sage terminal ("plot" not defined)

EDIT: OK, so basically, the Sage command line is not recognizing any sage commands (sqrt, etc) when they are contained in an imported .sage file. It's as if when I import a file to Sage, it doesn't read it using the Sage library. Is there something I have to add to the header of a .sage file for it to be read properly?


Old message:

So everything works fine in the sage notebook, and even if I pretty much rewrite the same commands in the Sage terminal. So it can't be a problem with the script.

But when I copy, paste and save the whole script as a standalone file.sage, and then try

run file.sage

... suddenly:

---> 30 multiPlot = plot(graphs, (x, 0, times[len(times)-1]+3), ymin=0)
    31 
    32 

NameError: name 'plot' is not defined

Why doesn't it read "plot" correctly and expect me to define it?