> What confused me is Learning Python's (O'Reilly "rat" book) mention of including
> library paths p. 22. But it doesn't make sense to have to worry about module
> paths and Python library paths in the same environment variable. Any idea what
> the "rat" was talking about?

I think that "module paths" and "Python library paths" are the same thing.

PYTHONPATH is an environment variables that allows you to add directories to the end
of the python search path.

>From inside python you can see the path that will be use with the following:

[u:\]
> python
Python 2.0 (#8, Dec 13 2000, 09:47:07) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', 'c:\\python20\\pythonwin', 'c:\\python20\\win32', 'c:\\python20\\win32\\lib', 
'c:\\python20', 'c:\\python20\\dlls',
 'c:\\python20\\lib', 'c:\\python20\\lib\\plat-win', 'c:\\python20\\lib\\lib-tk']
>>>

Now I will use python path:

[u:\]
> set PYTHONPATH=u:\users\barry\python;c:\local\python

[u:\]
> python
Python 2.0 (#8, Dec 13 2000, 09:47:07) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', 'u:\\users\\barry\\python', 'c:\\local\\python', 'c:\\python20\\pythonwin', 
'c:\\python20\\win32', 'c:\\python20\\w
in32\\lib', 'c:\\python20', 'c:\\python20\\dlls', 'c:\\python20\\lib', 
'c:\\python20\\lib\\plat-win', 'c:\\python20\\lib\\lib-tk']
>>>

Notice that the 2nd and 3rd elements of the list are inserted from PYTHONPATH.

        Barry


_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to