@@ -313,6 +313,8 @@ msgstr ""
313313msgid ""
314314"It can also be used when utilising :keyword:`from` with similar effects::"
315315msgstr ""
316+ "Это также можно использовать с :keyword:`from`, что даёт аналогичный "
317+ "эффект::"
316318
317319#: ../../tutorial/modules.rst:132
318320msgid ""
@@ -332,66 +334,88 @@ msgid ""
332334"use :func:`importlib.reload`, e.g. ``import importlib; "
333335"importlib.reload(modulename)``."
334336msgstr ""
337+ "По соображениям эффективности каждый модуль импортируется только один раз за"
338+ " сеанс интерпретатора. Поэтому, если вы меняете свои модули, вы должны "
339+ "перезапустить интерпретатор — или, если вы хотите протестировать в "
340+ "интерактивном режиме только один модуль, использовать "
341+ ":func:`importlib.reload`, например ``import importlib; importlib.reload(имя "
342+ "модуля)``."
335343
336344#: ../../tutorial/modules.rst:149
337345msgid "Executing modules as scripts"
338- msgstr ""
346+ msgstr "Выполнение модулей как скриптов "
339347
340348#: ../../tutorial/modules.rst:151
341349msgid "When you run a Python module with ::"
342- msgstr ""
350+ msgstr "Когда вы запускаете модуль Python с помощью :: "
343351
344352#: ../../tutorial/modules.rst:153
345353msgid "python fibo.py <arguments>"
346- msgstr ""
354+ msgstr "python fibo.py <arguments> "
347355
348356#: ../../tutorial/modules.rst:155
349357msgid ""
350358"the code in the module will be executed, just as if you imported it, but "
351359"with the ``__name__`` set to ``\" __main__\" ``. That means that by adding "
352360"this code at the end of your module::"
353361msgstr ""
362+ "код в модуле будет выполнен так же, как если бы вы его импортировали, но с "
363+ "параметром ``__name__``, установленным в ``\" __main__\" ``. Это означает, что"
364+ " добавив этот код в конец вашего модуля:"
354365
355366#: ../../tutorial/modules.rst:159
356367msgid ""
357368"if __name__ == \" __main__\" :\n"
358369" import sys\n"
359370" fib(int(sys.argv[1]))"
360371msgstr ""
372+ "if __name__ == \" __main__\" :\n"
373+ " import sys\n"
374+ " fib(int(sys.argv[1]))"
361375
362376#: ../../tutorial/modules.rst:163
363377msgid ""
364378"you can make the file usable as a script as well as an importable module, "
365379"because the code that parses the command line only runs if the module is "
366380"executed as the \" main\" file:"
367381msgstr ""
382+ "вы можете сделать файл пригодным как в качестве скрипта, так и в качестве "
383+ "импортируемого модуля, поскольку код, анализирующий аргументы командной "
384+ "строки, запускается только если модуль выполняется как «основной» файл:"
368385
369386#: ../../tutorial/modules.rst:167
370387msgid ""
371388"$ python fibo.py 50\n"
372389"0 1 1 2 3 5 8 13 21 34"
373390msgstr ""
391+ "$ python fibo.py 50\n"
392+ "0 1 1 2 3 5 8 13 21 34"
374393
375394#: ../../tutorial/modules.rst:172
376395msgid "If the module is imported, the code is not run::"
377- msgstr ""
396+ msgstr "Если модуль импортирован, этот код не выполняется:: "
378397
379398#: ../../tutorial/modules.rst:174
380399msgid ""
381400">>> import fibo\n"
382401">>>"
383402msgstr ""
403+ ">>> import fibo\n"
404+ ">>>"
384405
385406#: ../../tutorial/modules.rst:177
386407msgid ""
387408"This is often used either to provide a convenient user interface to a "
388409"module, or for testing purposes (running the module as a script executes a "
389410"test suite)."
390411msgstr ""
412+ "Это часто используется либо для предоставления удобного пользовательского "
413+ "интерфейса к модулю, либо для целей тестирования (запуск модуля как скрипта "
414+ "запускает набор тестов)."
391415
392416#: ../../tutorial/modules.rst:184
393417msgid "The Module Search Path"
394- msgstr ""
418+ msgstr "Путь поиска модулей "
395419
396420#: ../../tutorial/modules.rst:188
397421msgid ""
@@ -401,24 +425,36 @@ msgid ""
401425"named :file:`spam.py` in a list of directories given by the variable "
402426":data:`sys.path`. :data:`sys.path` is initialized from these locations:"
403427msgstr ""
428+ "Когда импортируется модуль с именем :mod:`!spam`, интерпретатор сначала ищет"
429+ " встроенный модуль с таким именем. Имена этих модулей перечислены в "
430+ ":data:`sys.builtin_module_names`. Если его там нет, интерпретатор ищет файл "
431+ "с именем :file:`spam.py` в каталогах, список которых задаётся переменной "
432+ ":data:`sys.path`. :data:`sys.path` инициализируется из следующих источников:"
404433
405434#: ../../tutorial/modules.rst:194
406435msgid ""
407436"The directory containing the input script (or the current directory when no "
408437"file is specified)."
409438msgstr ""
439+ "Каталог, содержащий входной скрипт (или текущий каталог, если файл не "
440+ "указан)."
410441
411442#: ../../tutorial/modules.rst:196
412443msgid ""
413444":envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the"
414445" shell variable :envvar:`PATH`)."
415446msgstr ""
447+ ":envvar:`PYTHONPATH` (список имён каталогов с тем же синтаксисом, что и "
448+ "переменная окружения :envvar:`PATH`)."
416449
417450#: ../../tutorial/modules.rst:198
418451msgid ""
419452"The installation-dependent default (by convention including a ``site-"
420453"packages`` directory, handled by the :mod:`site` module)."
421454msgstr ""
455+ "Значение по умолчанию, определяемое способом установки Python (обычно "
456+ "включает каталог ``site-packages``, который обрабатывается модулем "
457+ ":mod:`site`)."
422458
423459#: ../../tutorial/modules.rst:201
424460msgid "More details are at :ref:`sys-path-init`."
0 commit comments