|   | 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()
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.