When is a module imported from the standard library?

Dinu Gherman dinu at reportlab.com
Wed Aug 22 14:47:23 CEST 2001


On Wed, 22 Aug 2001 05:34:15 -0700, "Emile van Sebille"
<emile at fenx.com> wrote:

>Wouldn't the shortest entry in sys.path ending in lib give this to you?  If
>you're concerned that the path may have been tweaked maybe:
>
> o = os.popen('python -c "import sys;print sys.path"').read()

Well, there is no standard mandating it has to end in 'lib'.
On a Unix installation I could have '...lib/python2.1/' say...

Dinu

-- 
Dinu C. Gherman
dinu at reportlab dot com
http://www.reportlab.com
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or 
not. Otherwise you don't enjoy your work, you don't work well, 
and the project goes down the drain." 
                    (Kent Beck, "Extreme Programming Explained")



More information about the Python-list mailing list