11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2022 , Python Software Foundation
2+ # Copyright (C) 2001-2024 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # Jerry Chen <[email protected] >, 201787# eric R <[email protected] >, 201898# ww song <[email protected] >, 2018109# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2018
1110# jaystone776 <[email protected] >, 202112- # Freesand Leo <[email protected] >, 20221311# Alpha Du <[email protected] >, 202214- # Y.D.X., 2022
12+ # Rafael Fontenelle <[email protected] >, 202313+ # Freesand Leo <[email protected] >, 20241514#
1615#, fuzzy
1716msgid ""
1817msgstr ""
1918"Project-Id-Version : Python 3.9\n "
2019"Report-Msgid-Bugs-To : \n "
21- "POT-Creation-Date : 2022-11-04 14 :34+0000\n "
20+ "POT-Creation-Date : 2024-10-11 16 :34+0000\n "
2221"PO-Revision-Date : 2017-02-16 23:41+0000\n "
23- "Last-Translator : Y.D.X., 2022 \n "
24- "Language-Team : Chinese (China) (https://www .transifex.com/python-doc/teams/5390/zh_CN/)\n "
22+ "
Last-Translator :
Freesand Leo <[email protected] >, 2024 \n"
23+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
2524"MIME-Version : 1.0\n "
2625"Content-Type : text/plain; charset=UTF-8\n "
2726"Content-Transfer-Encoding : 8bit\n "
@@ -44,8 +43,8 @@ msgid ""
4443"programs without copying its definition into each program."
4544msgstr ""
4645"退出 Python 解释器后,再次进入时,之前在 Python "
47- "解释器中定义的函数和变量就丢失了。因此,编写较长程序时,建议用文本编辑器代替解释器 ,执行文件中的输入内容,这就是编写 *脚本* "
48- "。随着程序越来越长,为了方便维护,最好把脚本拆分成多个文件。编写脚本还一个好处,不同程序调用同一个函数时,不用每次把函数复制到各个程序 。"
46+ "解释器中定义的函数和变量就丢失了。因此,编写较长程序时,最好用文本编辑器代替解释器 ,执行文件中的输入内容,这就是编写 *脚本* "
47+ "。随着程序越来越长,为了方便维护,最好把脚本拆分成多个文件。编写脚本还一个好处,不同程序调用同一个函数时,不用把函数定义复制到各个程序 。"
4948
5049#: ../../tutorial/modules.rst:16
5150msgid ""
@@ -155,7 +154,7 @@ msgid ""
155154"package is frowned upon, since it often causes poorly readable code. "
156155"However, it is okay to use it to save typing in interactive sessions."
157156msgstr ""
158- "注意,一般情况下,不建议从模块或包内导入 ``*``, 因为,这项操作经常让代码变得难以理解。不过,为了在交互式编译器中少打几个字 ,这么用也没问题。 "
157+ "注意,一般情况下,不建议从模块或包内导入 ``*``,因为,这项操作经常让代码变得难以理解。不过,为了在交互式会话中少打几个字 ,这么用也没问题。"
159158
160159#: ../../tutorial/modules.rst:115
161160msgid ""
@@ -208,18 +207,18 @@ msgid ""
208207"you can make the file usable as a script as well as an importable module, "
209208"because the code that parses the command line only runs if the module is "
210209"executed as the \" main\" file:"
211- msgstr "既可以把这个文件当脚本使用,也可以用作导入的模块, 因为,解析命令行的代码只有在模块以 “main” 文件执行时才会运行:"
210+ msgstr "这个文件既能被用作脚本,又能被用作一个可供导入的模块,因为解析命令行参数的那两行代码只有在模块作为 “main”文件执行时才会运行:"
212211
213212#: ../../tutorial/modules.rst:169
214213msgid "If the module is imported, the code is not run::"
215- msgstr "导入模块时,不运行这些代码 :"
214+ msgstr "当这个模块被导入到其它模块时,那两行代码不运行 :"
216215
217216#: ../../tutorial/modules.rst:174
218217msgid ""
219218"This is often used either to provide a convenient user interface to a "
220219"module, or for testing purposes (running the module as a script executes a "
221220"test suite)."
222- msgstr "这种操作常用于为模块提供便捷用户接口 ,或用于测试(把模块当作执行测试套件的脚本运行 )。"
221+ msgstr "这常用于为模块提供一个便捷的用户接口 ,或用于测试(把模块作为执行测试套件的脚本运行 )。"
223222
224223#: ../../tutorial/modules.rst:181
225224msgid "The Module Search Path"
@@ -235,13 +234,13 @@ msgid ""
235234msgstr ""
236235"当一个名为 :mod:`spam` 的模块被导入时,解释器首先搜索具有该名称的内置模块。这些模块的名字被列在 "
237236":data:`sys.builtin_module_names` 中。如果没有找到,它就在变量 :data:`sys.path` "
238- "给出的目录列表中搜索一个名为 :file:`spam.py` 的文件, :data:`sys.path` 从这些位置初始化:"
237+ "给出的目录列表中搜索一个名为 :file:`spam.py` 的文件,:data:`sys.path` 从这些位置初始化:"
239238
240239#: ../../tutorial/modules.rst:191
241240msgid ""
242241"The directory containing the input script (or the current directory when no "
243242"file is specified)."
244- msgstr "输入脚本的目录 (或未指定文件时的当前目录)。"
243+ msgstr "被命令行直接运行的脚本所在的目录 (或未指定文件时的当前目录)。"
245244
246245#: ../../tutorial/modules.rst:193
247246msgid ""
@@ -261,8 +260,8 @@ msgid ""
261260"script is calculated after the symlink is followed. In other words the "
262261"directory containing the symlink is **not** added to the module search path."
263262msgstr ""
264- "在支持 symlink 的文件系统中,输入脚本目录是在追加 symlink 后计算出来的 。换句话说,包含 symlink 的目录并 **没有** "
265- "添加至模块搜索路径。 "
263+ "在支持符号链接的文件系统中,“被命令行直接运行的脚本所在的目录”是符号链接最终指向的目录 。换句话说,符号链接所在的目录并 **没有** "
264+ "被添加至模块搜索路径。 "
266265
267266#: ../../tutorial/modules.rst:203
268267msgid ""
@@ -274,8 +273,8 @@ msgid ""
274273" section :ref:`tut-standardmodules` for more information."
275274msgstr ""
276275"初始化后,Python 程序可以更改 "
277- ":data:`sys.path`。运行脚本的目录在标准库路径之前,置于搜索路径的开头。即,加载的是该目录里的脚本,而不是标准库的同名模块。 "
278- "除非刻意替换,否则会报错。详见 :ref:`tut-standardmodules`。"
276+ ":data:`sys.path`。脚本所在的目录先于标准库所在的路径被搜索。这意味着,脚本所在的目录如果有和标准库同名的文件,那么加载的是该目录里的,而不是标准库的。这一般是一个错误,除非这样的替换是你有意为之。详见 "
277+ " :ref:`tut-standardmodules`。"
279278
280279#: ../../tutorial/modules.rst:214
281280msgid "\" Compiled\" Python files"
@@ -292,10 +291,10 @@ msgid ""
292291"allows compiled modules from different releases and different versions of "
293292"Python to coexist."
294293msgstr ""
295- "为了快速加载模块,Python 把模块的编译版缓存在 ``__pycache__`` 目录中,文件名为 "
294+ "为了快速加载模块,Python 把模块的编译版本缓存在 ``__pycache__`` 目录中,文件名为 "
296295":file:`module.{version}.pyc`,version 对编译文件格式进行编码,一般是 Python 的版本号。例如,CPython "
297- "的 3.3 发行版中,spam.py 的编译版本缓存为 "
298- "``__pycache__/spam.cpython-33.pyc``。使用这种命名惯例,可以让不同 Python 发行版及不同版本的已编译模块共存 。"
296+ "的 3.3 发行版中,spam.py 的编译版本缓存为 ``__pycache__/spam.cpython-33.pyc``。这种命名惯例让不同 "
297+ "Python 版本编译的模块可以共存 。"
299298
300299#: ../../tutorial/modules.rst:224
301300msgid ""
@@ -306,7 +305,7 @@ msgid ""
306305"architectures."
307306msgstr ""
308307"Python "
309- "对比编译版本与源码的修改日期,查看它是否已过期 ,是否要重新编译,此过程完全自动化。 此外,编译模块与平台无关,因此,可在不同架构系统之间共享相同的支持库 。"
308+ "对比编译版与源码的修改日期,查看编译版是否已过期 ,是否要重新编译。此进程完全是自动的。 此外,编译模块与平台无关,因此,可在不同架构的系统之间共享相同的库 。"
310309
311310#: ../../tutorial/modules.rst:229
312311msgid ""
@@ -318,8 +317,7 @@ msgid ""
318317" must not be a source module."
319318msgstr ""
320319"Python "
321- "在两种情况下不检查缓存。其一,从命令行直接载入模块,只重新编译,不存储编译结果;其二,没有源模块,就不会检查缓存。为了支持无源文件(仅编译)发行版本, "
322- "编译模块必须在源目录下,并且绝不能有源模块。"
320+ "在两种情况下不检查缓存。一,从命令行直接载入的模块,每次都会重新编译,且不储存编译结果;二,没有源模块,就不会检查缓存。为了让一个库能以隐藏源代码的形式分发(通过将所有源代码变为编译后的版本),编译后的模块必须放在源目录而非缓存目录中,并且源目录绝不能包含同名的未编译的源模块。"
323321
324322#: ../../tutorial/modules.rst:236
325323msgid "Some tips for experts:"
@@ -377,10 +375,11 @@ msgid ""
377375"into every Python interpreter. The variables ``sys.ps1`` and ``sys.ps2`` "
378376"define the strings used as primary and secondary prompts::"
379377msgstr ""
380- "Python 附带了标准模块库,详见 Python "
381- "标准库参考手册(以下简称为“库参考”)。解释器中内置了一些模块,用于访问不属于语言核心的内置操作,其目的主要是为了提高运行效率,或访问系统调用等操作系统原语。这些模块的集合是依赖于底层平台的配置选项。例如,:mod:`winreg`"
382- " 模块仅供 Windows 使用。特别要注意内嵌到 Python 解释器中的模块 :mod:`sys`。变量 ``sys.ps1`` 和 "
383- "``sys.ps2`` 则用来定义主次提示的字符串:"
378+ "Python 自带一个标准模块的库,它在 Python 库参考(此处以下称为\" 库参考\" )里另外描述。 一些模块是内嵌到解释器里面的, "
379+ "它们给一些虽并非语言核心但却内嵌的操作提供接口,要么是为了效率,要么是给操作系统基础操作例如系统调入提供接口。 这些模块集是一个配置选项, "
380+ "并且还依赖于底层的操作系统。 例如,:mod:`winreg` 模块只在 Windows 系统上提供。一个特别值得注意的模块 "
381+ ":mod:`sys`,它被内嵌到每一个 Python 解释器中。``sys.ps1`` 和 ``sys.ps2`` "
382+ "变量定义了一些字符,它们可以用作主提示符和辅助提示符::"
384383
385384#: ../../tutorial/modules.rst:287
386385msgid ""
@@ -412,19 +411,19 @@ msgstr "内置函数 :func:`dir` 用于查找模块定义的名称。返回结
412411#: ../../tutorial/modules.rst:333
413412msgid ""
414413"Without arguments, :func:`dir` lists the names you have defined currently::"
415- msgstr "没有参数时,:func:`dir` 列出当前定义的名称 :"
414+ msgstr "没有参数时,:func:`dir` 列出当前已定义的名称 :"
416415
417416#: ../../tutorial/modules.rst:341
418417msgid ""
419418"Note that it lists all types of names: variables, modules, functions, etc."
420- msgstr "注意,该函数列出所有类型的名称 :变量、模块、函数等 。"
419+ msgstr "注意它列出所有类型的名称 :变量,模块,函数,…… 。"
421420
422421#: ../../tutorial/modules.rst:345
423422msgid ""
424423":func:`dir` does not list the names of built-in functions and variables. If"
425424" you want a list of those, they are defined in the standard module "
426425":mod:`builtins`::"
427- msgstr ":func:`dir` 不会列出内置函数和变量的名称。这些内容的定义在标准模块 :mod:`builtins` 里 :"
426+ msgstr ":func:`dir` 不会列出内置函数和变量的名称。这些内容的定义在标准模块 :mod:`builtins` 中 :"
428427
429428#: ../../tutorial/modules.rst:384
430429msgid "Packages"
@@ -457,9 +456,7 @@ msgid ""
457456"operations. Here's a possible structure for your package (expressed in "
458457"terms of a hierarchical filesystem):"
459458msgstr ""
460- "假设要为统一处理声音文件与声音数据设计一个模块集(“包”)。声音文件的格式很多(通常以扩展名来识别,例如::file:`.wav`, "
461- ":file:`.aiff`, "
462- ":file:`.au`),因此,为了不同文件格式之间的转换,需要创建和维护一个不断增长的模块集合。为了实现对声音数据的不同处理(例如,混声、添加回声、均衡器功能、创造人工立体声效果),还要编写无穷无尽的模块流。下面这个分级文件树展示了这个包的架构:"
459+ "假设要为统一处理声音文件与声音数据设计一个模块集(“包”)。声音文件的格式很多(通常以扩展名来识别,例如::file:`.wav`,:file:`.aiff`,:file:`.au`),因此,为了不同文件格式之间的转换,需要创建和维护一个不断增长的模块集合。为了实现对声音数据的不同处理(例如,混声、添加回声、均衡器功能、创造人工立体声效果),还要编写无穷无尽的模块流。下面这个分级文件树展示了这个包的架构:"
463460
464461#: ../../tutorial/modules.rst:431
465462msgid ""
@@ -550,7 +547,7 @@ msgid ""
550547"effects that should only happen when the sub-module is explicitly imported."
551548msgstr ""
552549"使用 ``from sound.effects import *`` "
553- "时会发生什么?理想情况下,该语句在文件系统查找并导入包的所有子模块。这项操作花费的时间较长,并且导入子模块可能会产生不必要的副作用,这种副作用只有在显式导入子模块时才会发生 。"
550+ "时会发生什么?你可能希望它会查找并导入包的所有子模块,但事实并非如此。因为这将花费很长的时间,并且可能会产生你不想要的副作用,如果这种副作用被你设计为只有在导入某个特定的子模块时才应该发生 。"
554551
555552#: ../../tutorial/modules.rst:495
556553msgid ""
@@ -564,17 +561,17 @@ msgid ""
564561"for importing \\ * from their package. For example, the file "
565562":file:`sound/effects/__init__.py` could contain the following code::"
566563msgstr ""
567- "唯一的解决方案是提供包的显式索引 。:keyword:`import` 语句使用如下惯例:如果包的 :file:`__init__.py` 代码定义了列表"
564+ "唯一的解决办法是提供包的显式索引 。:keyword:`import` 语句使用如下惯例:如果包的 :file:`__init__.py` 代码定义了列表"
568565" ``__all__``,运行 ``from package import *`` "
569- "时,它就是用于导入的模块名列表 。发布包的新版本时,包的作者应更新此列表。如果包的作者认为没有必要在包中执行导入 \\ * "
570- "操作,也可以不提供此列表。例如,:file:`sound/effects/__init__.py` 文件包含以下代码 :"
566+ "时,它就是被导入的模块名列表 。发布包的新版本时,包的作者应更新此列表。如果包的作者认为没有必要在包中执行导入 \\ * "
567+ "操作,也可以不提供此列表。例如,:file:`sound/effects/__init__.py` 文件可以包含以下代码 :"
571568
572569#: ../../tutorial/modules.rst:507
573570msgid ""
574571"This would mean that ``from sound.effects import *`` would import the three "
575572"named submodules of the :mod:`sound.effects` package."
576573msgstr ""
577- "这将意味着将 ``from sound.effects import *`` 导入 :mod:`sound.effects` 包的三个命名的子模块 。"
574+ "这意味着 ``from sound.effects import *`` 将导入 :mod:`sound.effects` 包的以上三个子模块 。"
578575
579576#: ../../tutorial/modules.rst:510
580577msgid ""
@@ -622,7 +619,7 @@ msgstr ""
622619
623620#: ../../tutorial/modules.rst:539
624621msgid "Intra-package References"
625- msgstr "子包参考 "
622+ msgstr "相对导入 "
626623
627624#: ../../tutorial/modules.rst:541
628625msgid ""
@@ -632,7 +629,7 @@ msgid ""
632629":mod:`sound.filters.vocoder` needs to use the :mod:`echo` module in the "
633630":mod:`sound.effects` package, it can use ``from sound.effects import echo``."
634631msgstr ""
635- "包中含有多个子包时 (与示例中的 :mod:`sound` 包一样),可以使用绝对导入引用兄弟包中的子模块 。例如,要在模块 "
632+ "包中内有多个子包时 (与示例中的 :mod:`sound` 包一样),可以使用绝对导入来引用兄弟包中的子模块 。例如,要在模块 "
636633":mod:`sound.filters.vocoder` 中使用 :mod:`sound.effects` 包的 :mod:`echo` 模块时,可以用"
637634" ``from sound.effects import echo`` 导入。"
638635
@@ -644,15 +641,17 @@ msgid ""
644641":mod:`surround` module for example, you might use::"
645642msgstr ""
646643"还可以用 import 语句的 ``from module import name`` "
647- "形式执行相对导入。这些导入语句使用前导句点表示相对导入中的当前包和父包 。例如,相对于 :mod:`surround` 模块,可以使用:"
644+ "形式执行相对导入。下面的导入语句使用前导句点表示相对导入中的当前包和父包 。例如,相对于 :mod:`surround` 模块,可以使用:"
648645
649646#: ../../tutorial/modules.rst:556
650647msgid ""
651648"Note that relative imports are based on the name of the current module. "
652649"Since the name of the main module is always ``\" __main__\" ``, modules "
653650"intended for use as the main module of a Python application must always use "
654651"absolute imports."
655- msgstr "注意,相对导入基于当前模块名。因为主模块名是 ``\" __main__\" `` ,所以 Python 程序的主模块必须始终使用绝对导入。"
652+ msgstr ""
653+ "注意,相对导入基于当前模块名。因为主模块名永远是 ``\" __main__\" `` ,所以如果计划将一个模块用作 Python "
654+ "应用程序的主模块,那么该模块内的导入语句必须始终使用绝对导入。"
656655
657656#: ../../tutorial/modules.rst:562
658657msgid "Packages in Multiple Directories"
@@ -666,8 +665,9 @@ msgid ""
666665"This variable can be modified; doing so affects future searches for modules "
667666"and subpackages contained in the package."
668667msgstr ""
669- "包还支持特殊属性 :attr:`__path__`。该属性初始化为在包的 :file:`__init__.py` "
670- "文件中的代码执行前所在的目录名列表。这个变量可以修改,但这样做会影响将来搜索包中模块和子包的操作。"
668+ "包还支持一个特殊属性 :attr:`__path__` 。在包的 :file:`__init__.py` "
669+ "中的代码被执行前,该属性被初始化为一个只含一项的列表,该项是一个字符串,是 __init__.py "
670+ "所在目录的名称。可以修改此变量;这样做会改变在此包中搜索模块和子包的方式。"
671671
672672#: ../../tutorial/modules.rst:570
673673msgid ""
@@ -677,7 +677,7 @@ msgstr "这个功能虽然不常用,但可用于扩展包中的模块集。"
677677
678678#: ../../tutorial/modules.rst:575
679679msgid "Footnotes"
680- msgstr "脚注 "
680+ msgstr "备注 "
681681
682682#: ../../tutorial/modules.rst:576
683683msgid ""
0 commit comments