| 1 | initial version |
You can add the following lines to the top of run.sage in order to change the current directory to path/project-base
import os
os.chdir(os.path.dirname(__file__))
How it works is that when you run sage path/project-base/run.sage, it converts run.sage into a Python module run.py. Within that module __file__ is a special global variable which is automatically set to the absolute path of that module.
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.