Ask Your Question

NevilleS's profile - activity

2019-05-22 11:08:22 +0200 received badge  Famous Question (source)
2013-07-26 10:56:03 +0200 received badge  Notable Question (source)
2013-01-11 11:52:02 +0200 received badge  Taxonomist
2012-03-21 18:54:57 +0200 received badge  Popular Question (source)
2012-01-17 08:18:51 +0200 received badge  Great Answer (source)
2011-12-21 20:31:44 +0200 received badge  Great Question (source)
2011-03-22 08:19:17 +0200 received badge  Good Answer (source)
2011-03-21 18:18:16 +0200 received badge  Nice Answer (source)
2011-03-21 09:53:16 +0200 received badge  Self-Learner (source)
2011-03-21 09:53:16 +0200 received badge  Teacher (source)
2011-03-21 09:32:03 +0200 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 17:56:36 +0200 received badge  Good Question (source)
2011-03-17 15:58:04 +0200 received badge  Nice Question (source)
2011-03-17 15:52:26 +0200 received badge  Supporter (source)
2011-03-17 15:52:20 +0200 commented answer Writing re-usable sage scripts

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

2011-03-17 11:08:16 +0200 received badge  Student (source)
2011-03-17 11:00:10 +0200 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?

Thanks