Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f0229aa5
Kaydet (Commit)
f0229aa5
authored
Ock 19, 2012
tarafından
Sandro Tosi
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11948: clarify modules search path
üst
972cfb91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
modules.rst
Doc/tutorial/modules.rst
+16
-18
No files found.
Doc/tutorial/modules.rst
Dosyayı görüntüle @
f0229aa5
...
@@ -159,24 +159,22 @@ The Module Search Path
...
@@ -159,24 +159,22 @@ The Module Search Path
.. index:: triple: module; search; path
.. index:: triple: module; search; path
When a module named :mod:`spam` is imported, the interpreter searches for a
When a module named :mod:`spam` is imported, the interpreter first searches for
file named :file:`spam.py` in the directory containing the input script and
a built-in module with that name. If not found, it then searches for a file
then in the list of directories specified by the environment variable
named :file:`spam.py` in a list of directories given by the variable
:envvar:`PYTHONPATH`. This has the same syntax as the shell variable
:data:`sys.path`. :data:`sys.path` is initialized from these locations:
:envvar:`PATH`, that is, a list of directory names. When :envvar:`PYTHONPATH`
is not set, or when the file is not found there, the search continues in an
* the directory containing the input script (or the current directory).
installation-dependent default path; on Unix, this is usually
* :envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the
:file:`.:/usr/local/lib/python`.
shell variable :envvar:`PATH`).
* the installation-dependent default.
Actually, modules are searched in the list of directories given by the variable
``sys.path`` which is initialized from the directory containing the input script
After initialization, Python programs can modify :data:`sys.path`. The
(or the current directory), :envvar:`PYTHONPATH` and the installation- dependent
directory containing the script being run is placed at the beginning of the
default. This allows Python programs that know what they'
re
doing
to
modify
or
search path, ahead of the standard library path. This means that scripts in that
replace
the
module
search
path
.
Note
that
because
the
directory
containing
the
directory will be loaded instead of modules of the same name in the library
script
being
run
is
on
the
search
path
,
it
is
important
that
the
script
not
have
directory. This is an error unless the replacement is intended. See section
the
same
name
as
a
standard
module
,
or
Python
will
attempt
to
load
the
script
as
:ref:`tut-standardmodules` for more information.
a
module
when
that
module
is
imported
.
This
will
generally
be
an
error
.
See
section
:
ref
:`
tut
-
standardmodules
`
for
more
information
.
.. %
.. %
Do we need stuff on zip files etc. ? DUBOIS
Do we need stuff on zip files etc. ? DUBOIS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment