module path?

Christian Heimes lists at cheimes.de
Tue Oct 6 20:04:02 CEST 2009


Dave Angel wrote:
> The property is called __file__
> 
> So in this case,    filename = settings.__file__

Actually it's an attribute set by Python's import machine. Since the
__file__ attribute may contain a relative path it's a good idea to use
os.path.abspath(__file__).

Christian




More information about the Python-list mailing list