Kaydet (Commit) 54ed2d32 authored tarafından Guido van Rossum's avatar Guido van Rossum

Clarify that the description of sys.path[0] is only valid upon program

start-up.
üst 754140e1
...@@ -282,10 +282,11 @@ else: ...@@ -282,10 +282,11 @@ else:
\begin{datadesc}{path} \begin{datadesc}{path}
\indexiii{module}{search}{path} \indexiii{module}{search}{path}
A list of strings that specifies the search path for modules. A list of strings that specifies the search path for modules.
Initialized from the environment variable \envvar{PYTHONPATH}, or an Initialized from the environment variable \envvar{PYTHONPATH}, plus an
installation-dependent default. installation-dependent default.
The first item of this list, \code{path[0]}, is the directory As initialized upon program startup,
the first item of this list, \code{path[0]}, is the directory
containing the script that was used to invoke the Python containing the script that was used to invoke the Python
interpreter. If the script directory is not available (e.g. if the interpreter. If the script directory is not available (e.g. if the
interpreter is invoked interactively or if the script is read from interpreter is invoked interactively or if the script is read from
...@@ -293,6 +294,8 @@ else: ...@@ -293,6 +294,8 @@ else:
Python to search modules in the current directory first. Notice Python to search modules in the current directory first. Notice
that the script directory is inserted \emph{before} the entries that the script directory is inserted \emph{before} the entries
inserted as a result of \envvar{PYTHONPATH}. inserted as a result of \envvar{PYTHONPATH}.
A program is free to modify this list for its own purposes.
\end{datadesc} \end{datadesc}
\begin{datadesc}{platform} \begin{datadesc}{platform}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment