Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Look at Python documentation: https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files

With Sage Notebbook you can do (download the file via Data menu):

f=open(DATA+"mydat.txt", "w")
for a in [0..10,step=2]:
     func=numerical_integral(cos(a*x),0,1)[0]
     s = " %4i  %8.4f \n"%(a,func)
     f.write(s)
f.close()