55#
66# Translators:
77# Alpha Du <[email protected] >, 20228- # Freesand Leo <[email protected] >, 202398# 乐成 王, 2024
9+ # Freesand Leo <[email protected] >, 20241010#
1111#, fuzzy
1212msgid ""
@@ -15,7 +15,7 @@ msgstr ""
1515"Report-Msgid-Bugs-To : \n "
1616"POT-Creation-Date : 2024-02-09 14:13+0000\n "
1717"PO-Revision-Date : 2021-06-28 00:54+0000\n "
18- "Last-Translator : 乐成 王 , 2024\n "
18+ "
Last-Translator :
Freesand Leo <[email protected] > , 2024\n"
1919"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2020"MIME-Version : 1.0\n "
2121"Content-Type : text/plain; charset=UTF-8\n "
@@ -25,23 +25,23 @@ msgstr ""
2525
2626#: ../../library/__main__.rst:2
2727msgid ":mod:`__main__` --- Top-level code environment"
28- msgstr ":mod:`__main__`——顶层代码环境"
28+ msgstr ":mod:`__main__` ——顶层代码环境"
2929
3030#: ../../library/__main__.rst:10
3131msgid ""
3232"In Python, the special name ``__main__`` is used for two important "
3333"constructs:"
34- msgstr "Python 中,特殊名 ``__main__`` 用于两个重要的构造:"
34+ msgstr "Python 的特殊名 ``__main__`` 用于两个重要的构造:"
3535
3636#: ../../library/__main__.rst:12
3737msgid ""
3838"the name of the top-level environment of the program, which can be checked "
3939"using the ``__name__ == '__main__'`` expression; and"
40- msgstr "程序的顶层环境的名称,可用 ``__name__ == '__main__'`` 表达式来检查 ;以及"
40+ msgstr "程序的顶层环境的名称,可用表达式 ``__name__ == '__main__'`` 来检查 ;以及"
4141
4242#: ../../library/__main__.rst:14
4343msgid "the ``__main__.py`` file in Python packages."
44- msgstr "Python 包中的 ``__main__.py`` 文件 。"
44+ msgstr "Python 包中的文件 ``__main__.py``。"
4545
4646#: ../../library/__main__.rst:16
4747msgid ""
@@ -50,8 +50,8 @@ msgid ""
5050"detail below. If you're new to Python modules, see the tutorial section "
5151":ref:`tut-modules` for an introduction."
5252msgstr ""
53- "这两个机制都和 Python 模块有关 ——用户与它们如何交互,及它们之间如何交互。 下文详述。教程的 :ref:`tut-modules` "
54- "一节为初学者介绍了 Python 模块。"
53+ "这两个机制都与 Python 模块相关 ——用户与它们如何交互,及它们之间如何交互—— 下文详述。而教程的 :ref:`tut-modules` "
54+ "一节则为初学者介绍了 Python 模块。"
5555
5656#: ../../library/__main__.rst:25
5757msgid "``__name__ == '__main__'``"
@@ -63,24 +63,23 @@ msgid ""
6363"module's name. Usually, this is the name of the Python file itself without "
6464"the ``.py`` extension::"
6565msgstr ""
66- "当一个 Python 模块或包被导入时,``__name__`` 会被设为模块的名称。 通常,这将是 Python 文件本身的名称去掉 ``.py`` "
67- "后缀::"
66+ "当一个 Python 模块或包被导入时,``__name__`` 被设为模块的名称——通常为 Python 文件本身的名称去掉 ``.py`` 后缀:"
6867
6968#: ../../library/__main__.rst:35
7069msgid ""
7170"If the file is part of a package, ``__name__`` will also include the parent "
7271"package's path::"
73- msgstr "如果文件是包的组成部分 ,则 ``__name__`` 还将包括父包的路径:: "
72+ msgstr "如果文件是包的一部分 ,则 ``__name__`` 还将包括父包的路径: "
7473
7574#: ../../library/__main__.rst:42
7675msgid ""
7776"However, if the module is executed in the top-level code environment, its "
7877"``__name__`` is set to the string ``'__main__'``."
79- msgstr "不过,如果模块是在最高层级代码环境中执行的,则它的 ``__name__`` 会被设为字符串 ``'__main__'``。"
78+ msgstr "而若模块是在顶层代码环境中执行的,则其 ``__name__`` 被设为字符串 ``'__main__'``。"
8079
8180#: ../../library/__main__.rst:46
8281msgid "What is the \" top-level code environment\" ?"
83- msgstr "什么是“最高层级代码环境 ”?"
82+ msgstr "什么是“顶层代码环境 ”?"
8483
8584#: ../../library/__main__.rst:48
8685msgid ""
@@ -90,61 +89,59 @@ msgid ""
9089"program needs. Sometimes \" top-level code\" is called an *entry point* to "
9190"the application."
9291msgstr ""
93- "``__main__`` 是最高层级代码运行所在环境的名称。 “最高层级代码”即用户指定最先启动运行的 Python 模块。 "
94- "它被称为“最高层级”是因为它将导入程序所需的所有其他模块。 有时“最高层级代码”也被称为应用的 *入口点*。"
92+ "``__main__`` 是顶层代码运行环境的名称。“顶层代码”是指由用户指定的最先开始运行的那一个 Python "
93+ "模块。之所以它是“顶层”,是因为它将导入程序所需的所有其它模块。 有时“顶层代码”被称为应用程序的 *入口点*。"
9594
9695#: ../../library/__main__.rst:53
9796msgid "The top-level code environment can be:"
98- msgstr "最高层级代码环境可以是: "
97+ msgstr "顶层代码环境可以是: "
9998
10099#: ../../library/__main__.rst:55
101100msgid "the scope of an interactive prompt::"
102- msgstr "一个交互提示符的作用域:: "
101+ msgstr "交互提示符的作用域: "
103102
104103#: ../../library/__main__.rst:60
105104msgid "the Python module passed to the Python interpreter as a file argument:"
106- msgstr "作为文件参数传给 Python 解释器的 Python 模块: "
105+ msgstr "作为文件参数传给 Python 解释器的 Python 模块: "
107106
108107#: ../../library/__main__.rst:67
109108msgid ""
110109"the Python module or package passed to the Python interpreter with the "
111110":option:`-m` argument:"
112- msgstr "作为 :option:`-m` 参数传给 Python 解释器的 Python 模块或包: "
111+ msgstr "与 :option:`-m` 一起传给 Python 解释器的 Python 模块或包: "
113112
114113#: ../../library/__main__.rst:75
115114msgid "Python code read by the Python interpreter from standard input:"
116- msgstr "Python 解释器从标准输入中读取的 Python 代码: "
115+ msgstr "Python 解释器从标准输入中读取的 Python 代码: "
117116
118117#: ../../library/__main__.rst:86
119118msgid ""
120119"Python code passed to the Python interpreter with the :option:`-c` argument:"
121- msgstr "作为 :option:`-c` 参数传递给 Python 解释器的 Python 代码: "
120+ msgstr "与 :option:`-c` 一起传给 Python 解释器的 Python 代码: "
122121
123122#: ../../library/__main__.rst:97
124123msgid ""
125124"In each of these situations, the top-level module's ``__name__`` is set to "
126125"``'__main__'``."
127- msgstr "在以上每个情形中,顶级模块的 ``__name__`` 被设置为 ``'__main__'`` 。"
126+ msgstr "上述每种情况中的顶层模块的 ``__name__`` 被设为 ``'__main__'``。"
128127
129128#: ../../library/__main__.rst:100
130129msgid ""
131130"As a result, a module can discover whether or not it is running in the top-"
132131"level environment by checking its own ``__name__``, which allows a common "
133132"idiom for conditionally executing code when the module is not initialized "
134133"from an import statement::"
135- msgstr ""
136- "因此,一个模块可以通过检查自己的 ``__name__`` "
137- ",来发现它是否在顶层环境中运行。这是允许在模块没有从导入语句中初始化的情况下,有条件地执行代码的一个常见的语句::"
134+ msgstr "作为结果,模块通过检查自己的 ``__name__`` 可发现自己是否运行于顶层环境,使一些代码仅当模块不是被导入语句初始化的时候才执行:"
138135
139136#: ../../library/__main__.rst:111
140137msgid ""
141138"For a more detailed look at how ``__name__`` is set in all situations, see "
142139"the tutorial section :ref:`tut-modules`."
143- msgstr "关于在所有情况下 ``__name__`` 是如何设置的细节,请看教程部分 :ref:`tut-modules` 。"
140+ msgstr "关于在所有情况下 ``__name__`` 是被如何设置的,详见教程的 :ref:`tut-modules` 一节 。"
144141
145142#: ../../library/__main__.rst:116 ../../library/__main__.rst:239
146143msgid "Idiomatic Usage"
147- msgstr "常见用法 "
144+ msgstr "惯用法 "
148145
149146#: ../../library/__main__.rst:118
150147msgid ""
0 commit comments