"ariza" <[EMAIL PROTECTED]> wrote:

> greetings. it seems that the attribute site.here, of the site module,
> has vanished in python 2.4. up until python 2.3, site.here seemed (to
> me at least) a convenient way to get the complete path to the python
> library on any platform.

"here" was a temporary variable used to get the exact location of
the LICENSE file.  in Python 2.4, that code has been moved into
a function, in which "here" is still a temporary variable.

was it documented somewhere else?

> can anyone propose a similarly effective and cross-platform solution
> for easily discovering the the library path on any python installation?

the library path is defined by the sys.path variable, which contains a list
of library directories.

sys.prefix gives you the installation root, sys.executable tells you where
the interpreter is.

if you need the exact behaviour of "site.here", you can do

    import os
    here = os.path.dirname(os.__file__)

but I don't really see why your program should have to care about
anything but the path...

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to