| 1 | Welcome to the "PC" subdirectory of the Python distribution
|
|---|
| 2 | ***********************************************************
|
|---|
| 3 |
|
|---|
| 4 | *** Note: the project files for MS VC++ 7.1 are now in the
|
|---|
| 5 | *** PCbuild directory. See the file readme.txt there for build
|
|---|
| 6 | *** instructions. There is some information below that might
|
|---|
| 7 | *** still be relevant.
|
|---|
| 8 |
|
|---|
| 9 | This "PC" subdirectory contains complete project files to make
|
|---|
| 10 | several older PC ports of Python, as well as all the PC-specific
|
|---|
| 11 | Python source files. It should be located in the root of the
|
|---|
| 12 | Python distribution, and there should be directories "Modules",
|
|---|
| 13 | "Objects", "Python", etc. in the parent directory of this "PC"
|
|---|
| 14 | subdirectory. Be sure to read the documentation in the Python
|
|---|
| 15 | distribution.
|
|---|
| 16 |
|
|---|
| 17 | Python requires library files such as string.py to be available in
|
|---|
| 18 | one or more library directories. The search path of libraries is
|
|---|
| 19 | set up when Python starts. To see the current Python library search
|
|---|
| 20 | path, start Python and enter "import sys" and "print sys.path".
|
|---|
| 21 |
|
|---|
| 22 | All PC ports use this scheme to try to set up a module search path:
|
|---|
| 23 |
|
|---|
| 24 | 1) The script location; the current directory without script.
|
|---|
| 25 | 2) The PYTHONPATH variable, if set.
|
|---|
| 26 | 3) For Win32 platforms (NT/95), paths specified in the Registry.
|
|---|
| 27 | 4) Default directories lib, lib/win, lib/test, lib/tkinter;
|
|---|
| 28 | these are searched relative to the environment variable
|
|---|
| 29 | PYTHONHOME, if set, or relative to the executable and its
|
|---|
| 30 | ancestors, if a landmark file (Lib/string.py) is found ,
|
|---|
| 31 | or the current directory (not useful).
|
|---|
| 32 | 5) The directory containing the executable.
|
|---|
| 33 |
|
|---|
| 34 | The best installation strategy is to put the Python executable (and
|
|---|
| 35 | DLL, for Win32 platforms) in some convenient directory such as
|
|---|
| 36 | C:/python, and copy all library files and subdirectories (using XCOPY)
|
|---|
| 37 | to C:/python/lib. Then you don't need to set PYTHONPATH. Otherwise,
|
|---|
| 38 | set the environment variable PYTHONPATH to your Python search path.
|
|---|
| 39 | For example,
|
|---|
| 40 | set PYTHONPATH=.;d:\python\lib;d:\python\lib\win;d:\python\lib\dos-8x3
|
|---|
| 41 |
|
|---|
| 42 | There are several add-in modules to build Python programs which use
|
|---|
| 43 | the native Windows operating environment. The ports here just make
|
|---|
|
|---|