June 2000
Intermediate to advanced
556 pages
8h 45m
English
Python does a lot of work to guess where to look for the modules it needs to import. You can see the fruit of its labors by looking at the path variable of the sys module. Each directory listed in this path will be searched for modules when an import statement is executed. You can add directories to this list if you need to by means of an environment variable called PYTHONPATH.
Here is my path on Windows NT:
CD-ROM reference=6021.txt >>> import sys >>> print sys.path ['', 'c:\\', C:\\PROGRA~1\\PYTHON', 'C:\\Program Files\\Python\\Lib\\plat-win', 'C:\\Program Files\\Python\\Lib', 'C:\\Program Files\\Python\\DLLs', 'C:\\Program Files\\Python\\Lib\\lib-tk', 'c:\\program files\\python\\DLLs', 'c:\\program files\\python\\lib', ...
Read now
Unlock full access