answered 7 years ago
make a text file with the extension .sage
http://doc.sagemath.org/html/en/tutorial/programming.html#loading-and-attaching-sage-files