ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 24 Feb 2021 12:41:31 +0100TypeError: 'tuple' object is not callable on notebook but not on terminalhttps://ask.sagemath.org/question/55874/typeerror-tuple-object-is-not-callable-on-notebook-but-not-on-terminal/Code :
x=var('x')
y=function('y')(x)
k= var('k')
assume(k>0)
harmonic2 = diff(y,x,2)+k*y == 0
desolve(harmonic2, y, ivar = x)
Error :
TypeError Traceback (most recent call last) <ipython-input-54-ef4195c42a80> in <module>
4 assume(k>Integer(0))
5 harmonic2 = diff(y,x,Integer(2))+k*y == Integer(0)
----> 6 desolve(harmonic2, y, ivar = x)
TypeError: 'tuple' object is not callable
Why does this happen when i tried it in notebook but when i tried it in notepad but it ran fine on the terminalmath1styearstudentWed, 24 Feb 2021 12:41:31 +0100https://ask.sagemath.org/question/55874/Script stops working when imported to sage terminal ("plot" not defined)https://ask.sagemath.org/question/8811/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?fakaffWed, 21 Mar 2012 18:46:24 +0100https://ask.sagemath.org/question/8811/