Ask Your Question

Revision history [back]

To get the full path of the current directory you can use the os Python module as follows

sage: import os
sage: os.path.abspath(os.curdir)
'/home/thatsme/'

However, there is no such thing such as a Python environment variable to tell you the name of the current worksheet (that I know of). This woud be much simpler within a Python script.