Ask Your Question

NevilleS's profile - activity

2019-05-22 04:08:22 -0600 received badge  Famous Question (source)
2013-07-26 03:56:03 -0600 received badge  Notable Question (source)
2013-01-11 04:52:02 -0600 received badge  Taxonomist
2012-03-21 12:54:57 -0600 received badge  Popular Question (source)
2012-01-17 01:18:51 -0600 received badge  Great Answer (source)
2011-12-21 13:31:44 -0600 received badge  Great Question (source)
2011-03-22 02:19:17 -0600 received badge  Good Answer (source)
2011-03-21 12:18:16 -0600 received badge  Nice Answer (source)
2011-03-21 03:53:16 -0600 received badge  Self-Learner (source)
2011-03-21 03:53:16 -0600 received badge  Teacher (source)
2011-03-21 03:32:03 -0600 answered a question Writing re-usable sage scripts

I'm going to repost Felix's comment as my chosen answer, since it could be missed in the comments there:

Since Sage 4.6.1, you can do load_attach_path('/home/mike/Projects/Sage/') and then attach 'defaults.sage' etc. should just work.

This works reasonably well for me since I can add my "library" path to the sage path and define sage files there.

2011-03-17 11:56:36 -0600 received badge  Good Question (source)
2011-03-17 09:58:04 -0600 received badge  Nice Question (source)
2011-03-17 09:52:26 -0600 received badge  Supporter (source)
2011-03-17 09:52:20 -0600 commented answer Writing re-usable sage scripts

Well, that's certainly better than what I had thus far. Thanks for this.

2011-03-17 05:08:16 -0600 received badge  Student (source)
2011-03-17 05:00:10 -0600 asked a question Writing re-usable sage scripts

I'm looking to write some reusable code to do things like parse a particular file format outputted by some of my tools, but I don't see a particularly obvious "right way" to do this. I can define a python module, add it to the python path using the init.sage file, and then import it, but then I don't get some of the nice features I would get if I just loaded a .sage file from my current directory (namely tab-complete...).

Is there a preferred directory where I can save .sage files for use with the "load" commmand? If so, is there a way to specify a directory that is not in the SAGE_ROOT area, so I can source-control my specific .sage files independent of the sage installation?