1
1
# SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022 , Python Software Foundation
2
+ # Copyright (C) 2001-2024 , Python Software Foundation
3
3
# This file is distributed under the same license as the Python package.
4
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
#
6
6
# Translators:
7
- # Jerry Chen <jerrychen9657@gmail.com>, 2017
8
7
# eric R <trencyclopedia@gmail.com>, 2018
9
8
# ww song <sww4718168@gmail.com>, 2018
10
9
# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2018
11
10
# jaystone776 <1732865113@qq.com>, 2021
12
- # Freesand Leo <yuqinju@163.com>, 2022
13
11
# Alpha Du <alphanow@gmail.com>, 2022
14
- # Y.D.X., 2022
12
+ # Rafael Fontenelle <rffontenelle@gmail.com>, 2023
13
+ # Freesand Leo <yuqinju@163.com>, 2024
15
14
#
16
15
#, fuzzy
17
16
msgid ""
18
17
msgstr ""
19
18
"Project-Id-Version : Python 3.9\n "
20
19
"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 "
22
21
"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 <yuqinju@163.com>, 2024 \n "
23
+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
25
24
"MIME-Version : 1.0\n "
26
25
"Content-Type : text/plain; charset=UTF-8\n "
27
26
"Content-Transfer-Encoding : 8bit\n "
@@ -44,8 +43,8 @@ msgid ""
44
43
"programs without copying its definition into each program."
45
44
msgstr ""
46
45
"退出 Python 解释器后,再次进入时,之前在 Python "
47
- "解释器中定义的函数和变量就丢失了。因此,编写较长程序时,建议用文本编辑器代替解释器 ,执行文件中的输入内容,这就是编写 *脚本* "
48
- "。随着程序越来越长,为了方便维护,最好把脚本拆分成多个文件。编写脚本还一个好处,不同程序调用同一个函数时,不用每次把函数复制到各个程序 。"
46
+ "解释器中定义的函数和变量就丢失了。因此,编写较长程序时,最好用文本编辑器代替解释器 ,执行文件中的输入内容,这就是编写 *脚本* "
47
+ "。随着程序越来越长,为了方便维护,最好把脚本拆分成多个文件。编写脚本还一个好处,不同程序调用同一个函数时,不用把函数定义复制到各个程序 。"
49
48
50
49
#: ../../tutorial/modules.rst:16
51
50
msgid ""
@@ -155,7 +154,7 @@ msgid ""
155
154
"package is frowned upon, since it often causes poorly readable code. "
156
155
"However, it is okay to use it to save typing in interactive sessions."
157
156
msgstr ""
158
- "注意,一般情况下,不建议从模块或包内导入 ``*``, 因为,这项操作经常让代码变得难以理解。不过,为了在交互式编译器中少打几个字 ,这么用也没问题。 "
157
+ "注意,一般情况下,不建议从模块或包内导入 ``*``,因为,这项操作经常让代码变得难以理解。不过,为了在交互式会话中少打几个字 ,这么用也没问题。"
159
158
160
159
#: ../../tutorial/modules.rst:115
161
160
msgid ""
@@ -208,18 +207,18 @@ msgid ""
208
207
"you can make the file usable as a script as well as an importable module, "
209
208
"because the code that parses the command line only runs if the module is "
210
209
"executed as the \" main\" file:"
211
- msgstr "既可以把这个文件当脚本使用,也可以用作导入的模块, 因为,解析命令行的代码只有在模块以 “main” 文件执行时才会运行:"
210
+ msgstr "这个文件既能被用作脚本,又能被用作一个可供导入的模块,因为解析命令行参数的那两行代码只有在模块作为 “main”文件执行时才会运行:"
212
211
213
212
#: ../../tutorial/modules.rst:169
214
213
msgid "If the module is imported, the code is not run::"
215
- msgstr "导入模块时,不运行这些代码 :"
214
+ msgstr "当这个模块被导入到其它模块时,那两行代码不运行 :"
216
215
217
216
#: ../../tutorial/modules.rst:174
218
217
msgid ""
219
218
"This is often used either to provide a convenient user interface to a "
220
219
"module, or for testing purposes (running the module as a script executes a "
221
220
"test suite)."
222
- msgstr "这种操作常用于为模块提供便捷用户接口 ,或用于测试(把模块当作执行测试套件的脚本运行 )。"
221
+ msgstr "这常用于为模块提供一个便捷的用户接口 ,或用于测试(把模块作为执行测试套件的脚本运行 )。"
223
222
224
223
#: ../../tutorial/modules.rst:181
225
224
msgid "The Module Search Path"
@@ -235,13 +234,13 @@ msgid ""
235
234
msgstr ""
236
235
"当一个名为 :mod:`spam` 的模块被导入时,解释器首先搜索具有该名称的内置模块。这些模块的名字被列在 "
237
236
":data:`sys.builtin_module_names` 中。如果没有找到,它就在变量 :data:`sys.path` "
238
- "给出的目录列表中搜索一个名为 :file:`spam.py` 的文件, :data:`sys.path` 从这些位置初始化:"
237
+ "给出的目录列表中搜索一个名为 :file:`spam.py` 的文件,:data:`sys.path` 从这些位置初始化:"
239
238
240
239
#: ../../tutorial/modules.rst:191
241
240
msgid ""
242
241
"The directory containing the input script (or the current directory when no "
243
242
"file is specified)."
244
- msgstr "输入脚本的目录 (或未指定文件时的当前目录)。"
243
+ msgstr "被命令行直接运行的脚本所在的目录 (或未指定文件时的当前目录)。"
245
244
246
245
#: ../../tutorial/modules.rst:193
247
246
msgid ""
@@ -261,8 +260,8 @@ msgid ""
261
260
"script is calculated after the symlink is followed. In other words the "
262
261
"directory containing the symlink is **not** added to the module search path."
263
262
msgstr ""
264
- "在支持 symlink 的文件系统中,输入脚本目录是在追加 symlink 后计算出来的 。换句话说,包含 symlink 的目录并 **没有** "
265
- "添加至模块搜索路径。 "
263
+ "在支持符号链接的文件系统中,“被命令行直接运行的脚本所在的目录”是符号链接最终指向的目录 。换句话说,符号链接所在的目录并 **没有** "
264
+ "被添加至模块搜索路径。 "
266
265
267
266
#: ../../tutorial/modules.rst:203
268
267
msgid ""
@@ -274,8 +273,8 @@ msgid ""
274
273
" section :ref:`tut-standardmodules` for more information."
275
274
msgstr ""
276
275
"初始化后,Python 程序可以更改 "
277
- ":data:`sys.path`。运行脚本的目录在标准库路径之前,置于搜索路径的开头。即,加载的是该目录里的脚本,而不是标准库的同名模块。 "
278
- "除非刻意替换,否则会报错。详见 :ref:`tut-standardmodules`。"
276
+ ":data:`sys.path`。脚本所在的目录先于标准库所在的路径被搜索。这意味着,脚本所在的目录如果有和标准库同名的文件,那么加载的是该目录里的,而不是标准库的。这一般是一个错误,除非这样的替换是你有意为之。详见 "
277
+ " :ref:`tut-standardmodules`。"
279
278
280
279
#: ../../tutorial/modules.rst:214
281
280
msgid "\" Compiled\" Python files"
@@ -292,10 +291,10 @@ msgid ""
292
291
"allows compiled modules from different releases and different versions of "
293
292
"Python to coexist."
294
293
msgstr ""
295
- "为了快速加载模块,Python 把模块的编译版缓存在 ``__pycache__`` 目录中,文件名为 "
294
+ "为了快速加载模块,Python 把模块的编译版本缓存在 ``__pycache__`` 目录中,文件名为 "
296
295
":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 版本编译的模块可以共存 。"
299
298
300
299
#: ../../tutorial/modules.rst:224
301
300
msgid ""
@@ -306,7 +305,7 @@ msgid ""
306
305
"architectures."
307
306
msgstr ""
308
307
"Python "
309
- "对比编译版本与源码的修改日期,查看它是否已过期 ,是否要重新编译,此过程完全自动化。 此外,编译模块与平台无关,因此,可在不同架构系统之间共享相同的支持库 。"
308
+ "对比编译版与源码的修改日期,查看编译版是否已过期 ,是否要重新编译。此进程完全是自动的。 此外,编译模块与平台无关,因此,可在不同架构的系统之间共享相同的库 。"
310
309
311
310
#: ../../tutorial/modules.rst:229
312
311
msgid ""
@@ -318,8 +317,7 @@ msgid ""
318
317
" must not be a source module."
319
318
msgstr ""
320
319
"Python "
321
- "在两种情况下不检查缓存。其一,从命令行直接载入模块,只重新编译,不存储编译结果;其二,没有源模块,就不会检查缓存。为了支持无源文件(仅编译)发行版本, "
322
- "编译模块必须在源目录下,并且绝不能有源模块。"
320
+ "在两种情况下不检查缓存。一,从命令行直接载入的模块,每次都会重新编译,且不储存编译结果;二,没有源模块,就不会检查缓存。为了让一个库能以隐藏源代码的形式分发(通过将所有源代码变为编译后的版本),编译后的模块必须放在源目录而非缓存目录中,并且源目录绝不能包含同名的未编译的源模块。"
323
321
324
322
#: ../../tutorial/modules.rst:236
325
323
msgid "Some tips for experts:"
@@ -377,10 +375,11 @@ msgid ""
377
375
"into every Python interpreter. The variables ``sys.ps1`` and ``sys.ps2`` "
378
376
"define the strings used as primary and secondary prompts::"
379
377
msgstr ""
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
+ "变量定义了一些字符,它们可以用作主提示符和辅助提示符::"
384
383
385
384
#: ../../tutorial/modules.rst:287
386
385
msgid ""
@@ -412,19 +411,19 @@ msgstr "内置函数 :func:`dir` 用于查找模块定义的名称。返回结
412
411
#: ../../tutorial/modules.rst:333
413
412
msgid ""
414
413
"Without arguments, :func:`dir` lists the names you have defined currently::"
415
- msgstr "没有参数时,:func:`dir` 列出当前定义的名称 :"
414
+ msgstr "没有参数时,:func:`dir` 列出当前已定义的名称 :"
416
415
417
416
#: ../../tutorial/modules.rst:341
418
417
msgid ""
419
418
"Note that it lists all types of names: variables, modules, functions, etc."
420
- msgstr "注意,该函数列出所有类型的名称 :变量、模块、函数等 。"
419
+ msgstr "注意它列出所有类型的名称 :变量,模块,函数,…… 。"
421
420
422
421
#: ../../tutorial/modules.rst:345
423
422
msgid ""
424
423
":func:`dir` does not list the names of built-in functions and variables. If"
425
424
" you want a list of those, they are defined in the standard module "
426
425
":mod:`builtins`::"
427
- msgstr ":func:`dir` 不会列出内置函数和变量的名称。这些内容的定义在标准模块 :mod:`builtins` 里 :"
426
+ msgstr ":func:`dir` 不会列出内置函数和变量的名称。这些内容的定义在标准模块 :mod:`builtins` 中 :"
428
427
429
428
#: ../../tutorial/modules.rst:384
430
429
msgid "Packages"
@@ -457,9 +456,7 @@ msgid ""
457
456
"operations. Here's a possible structure for your package (expressed in "
458
457
"terms of a hierarchical filesystem):"
459
458
msgstr ""
460
- "假设要为统一处理声音文件与声音数据设计一个模块集(“包”)。声音文件的格式很多(通常以扩展名来识别,例如::file:`.wav`, "
461
- ":file:`.aiff`, "
462
- ":file:`.au`),因此,为了不同文件格式之间的转换,需要创建和维护一个不断增长的模块集合。为了实现对声音数据的不同处理(例如,混声、添加回声、均衡器功能、创造人工立体声效果),还要编写无穷无尽的模块流。下面这个分级文件树展示了这个包的架构:"
459
+ "假设要为统一处理声音文件与声音数据设计一个模块集(“包”)。声音文件的格式很多(通常以扩展名来识别,例如::file:`.wav`,:file:`.aiff`,:file:`.au`),因此,为了不同文件格式之间的转换,需要创建和维护一个不断增长的模块集合。为了实现对声音数据的不同处理(例如,混声、添加回声、均衡器功能、创造人工立体声效果),还要编写无穷无尽的模块流。下面这个分级文件树展示了这个包的架构:"
463
460
464
461
#: ../../tutorial/modules.rst:431
465
462
msgid ""
@@ -550,7 +547,7 @@ msgid ""
550
547
"effects that should only happen when the sub-module is explicitly imported."
551
548
msgstr ""
552
549
"使用 ``from sound.effects import *`` "
553
- "时会发生什么?理想情况下,该语句在文件系统查找并导入包的所有子模块。这项操作花费的时间较长,并且导入子模块可能会产生不必要的副作用,这种副作用只有在显式导入子模块时才会发生 。"
550
+ "时会发生什么?你可能希望它会查找并导入包的所有子模块,但事实并非如此。因为这将花费很长的时间,并且可能会产生你不想要的副作用,如果这种副作用被你设计为只有在导入某个特定的子模块时才应该发生 。"
554
551
555
552
#: ../../tutorial/modules.rst:495
556
553
msgid ""
@@ -564,17 +561,17 @@ msgid ""
564
561
"for importing \\ * from their package. For example, the file "
565
562
":file:`sound/effects/__init__.py` could contain the following code::"
566
563
msgstr ""
567
- "唯一的解决方案是提供包的显式索引 。:keyword:`import` 语句使用如下惯例:如果包的 :file:`__init__.py` 代码定义了列表"
564
+ "唯一的解决办法是提供包的显式索引 。:keyword:`import` 语句使用如下惯例:如果包的 :file:`__init__.py` 代码定义了列表"
568
565
" ``__all__``,运行 ``from package import *`` "
569
- "时,它就是用于导入的模块名列表 。发布包的新版本时,包的作者应更新此列表。如果包的作者认为没有必要在包中执行导入 \\ * "
570
- "操作,也可以不提供此列表。例如,:file:`sound/effects/__init__.py` 文件包含以下代码 :"
566
+ "时,它就是被导入的模块名列表 。发布包的新版本时,包的作者应更新此列表。如果包的作者认为没有必要在包中执行导入 \\ * "
567
+ "操作,也可以不提供此列表。例如,:file:`sound/effects/__init__.py` 文件可以包含以下代码 :"
571
568
572
569
#: ../../tutorial/modules.rst:507
573
570
msgid ""
574
571
"This would mean that ``from sound.effects import *`` would import the three "
575
572
"named submodules of the :mod:`sound.effects` package."
576
573
msgstr ""
577
- "这将意味着将 ``from sound.effects import *`` 导入 :mod:`sound.effects` 包的三个命名的子模块 。"
574
+ "这意味着 ``from sound.effects import *`` 将导入 :mod:`sound.effects` 包的以上三个子模块 。"
578
575
579
576
#: ../../tutorial/modules.rst:510
580
577
msgid ""
@@ -622,7 +619,7 @@ msgstr ""
622
619
623
620
#: ../../tutorial/modules.rst:539
624
621
msgid "Intra-package References"
625
- msgstr "子包参考 "
622
+ msgstr "相对导入 "
626
623
627
624
#: ../../tutorial/modules.rst:541
628
625
msgid ""
@@ -632,7 +629,7 @@ msgid ""
632
629
":mod:`sound.filters.vocoder` needs to use the :mod:`echo` module in the "
633
630
":mod:`sound.effects` package, it can use ``from sound.effects import echo``."
634
631
msgstr ""
635
- "包中含有多个子包时 (与示例中的 :mod:`sound` 包一样),可以使用绝对导入引用兄弟包中的子模块 。例如,要在模块 "
632
+ "包中内有多个子包时 (与示例中的 :mod:`sound` 包一样),可以使用绝对导入来引用兄弟包中的子模块 。例如,要在模块 "
636
633
":mod:`sound.filters.vocoder` 中使用 :mod:`sound.effects` 包的 :mod:`echo` 模块时,可以用"
637
634
" ``from sound.effects import echo`` 导入。"
638
635
@@ -644,15 +641,17 @@ msgid ""
644
641
":mod:`surround` module for example, you might use::"
645
642
msgstr ""
646
643
"还可以用 import 语句的 ``from module import name`` "
647
- "形式执行相对导入。这些导入语句使用前导句点表示相对导入中的当前包和父包 。例如,相对于 :mod:`surround` 模块,可以使用:"
644
+ "形式执行相对导入。下面的导入语句使用前导句点表示相对导入中的当前包和父包 。例如,相对于 :mod:`surround` 模块,可以使用:"
648
645
649
646
#: ../../tutorial/modules.rst:556
650
647
msgid ""
651
648
"Note that relative imports are based on the name of the current module. "
652
649
"Since the name of the main module is always ``\" __main__\" ``, modules "
653
650
"intended for use as the main module of a Python application must always use "
654
651
"absolute imports."
655
- msgstr "注意,相对导入基于当前模块名。因为主模块名是 ``\" __main__\" `` ,所以 Python 程序的主模块必须始终使用绝对导入。"
652
+ msgstr ""
653
+ "注意,相对导入基于当前模块名。因为主模块名永远是 ``\" __main__\" `` ,所以如果计划将一个模块用作 Python "
654
+ "应用程序的主模块,那么该模块内的导入语句必须始终使用绝对导入。"
656
655
657
656
#: ../../tutorial/modules.rst:562
658
657
msgid "Packages in Multiple Directories"
@@ -666,8 +665,9 @@ msgid ""
666
665
"This variable can be modified; doing so affects future searches for modules "
667
666
"and subpackages contained in the package."
668
667
msgstr ""
669
- "包还支持特殊属性 :attr:`__path__`。该属性初始化为在包的 :file:`__init__.py` "
670
- "文件中的代码执行前所在的目录名列表。这个变量可以修改,但这样做会影响将来搜索包中模块和子包的操作。"
668
+ "包还支持一个特殊属性 :attr:`__path__` 。在包的 :file:`__init__.py` "
669
+ "中的代码被执行前,该属性被初始化为一个只含一项的列表,该项是一个字符串,是 __init__.py "
670
+ "所在目录的名称。可以修改此变量;这样做会改变在此包中搜索模块和子包的方式。"
671
671
672
672
#: ../../tutorial/modules.rst:570
673
673
msgid ""
@@ -677,7 +677,7 @@ msgstr "这个功能虽然不常用,但可用于扩展包中的模块集。"
677
677
678
678
#: ../../tutorial/modules.rst:575
679
679
msgid "Footnotes"
680
- msgstr "脚注 "
680
+ msgstr "备注 "
681
681
682
682
#: ../../tutorial/modules.rst:576
683
683
msgid ""
0 commit comments