| 1 | initial version |
In the file ~.sage/init.sage, you may write the following code:
import os
if os.path.exists('init.sage'):
%runfile init.sage
which will automatically run the file init.sage if there is such a file in the current folder.
Then, you can put your desired code in that file in your working directory which will get run when you start sage.
| 2 | No.2 Revision |
In the file ~.sage/init.sage, you may write the following code:
import os
if os.path.exists('init.sage'):
%runfile init.sage
which will automatically run the file init.sage if there is such a file in the current folder.
folder. Then, you can put your desired code in that file in your working directory which will get run first when you start sage.
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.