1
1
# SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2023 , 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
- # Rafael Fontenelle <[email protected] >, 2023
7
+ # Rafael Fontenelle <[email protected] >, 2024
8
8
#
9
9
#, fuzzy
10
10
msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.10\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2023-07-29 03:05 +0000\n "
14
+ "POT-Creation-Date : 2024-02-16 18:51 +0000\n "
15
15
"PO-Revision-Date : 2022-11-05 17:21+0000\n "
16
- "
Last-Translator :
Rafael Fontenelle <[email protected] >, 2023 \n "
16
+ "
Last-Translator :
Rafael Fontenelle <[email protected] >, 2024 \n "
17
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
18
18
"MIME-Version : 1.0\n "
19
19
"Content-Type : text/plain; charset=UTF-8\n "
@@ -23,23 +23,23 @@ msgstr ""
23
23
24
24
#: ../../library/__main__.rst:2
25
25
msgid ":mod:`__main__` --- Top-level code environment"
26
- msgstr ":mod:`__main__` --- 最高层级代码环境 "
26
+ msgstr ":mod:`__main__` ——顶层代码环境 "
27
27
28
28
#: ../../library/__main__.rst:10
29
29
msgid ""
30
30
"In Python, the special name ``__main__`` is used for two important "
31
31
"constructs:"
32
- msgstr "在 Python 中,特殊名称 ``__main__`` 被用于两个重要的构造: "
32
+ msgstr "Python 的特殊名 ``__main__`` 用于两个重要的构造: "
33
33
34
34
#: ../../library/__main__.rst:12
35
35
msgid ""
36
36
"the name of the top-level environment of the program, which can be checked "
37
37
"using the ``__name__ == '__main__'`` expression; and"
38
- msgstr "程序的最高层级环境的名称,可以使用 ``__name__ == '__main__'`` 表达式来检查它 ;以及"
38
+ msgstr "程序的顶层环境的名称,可用表达式 ``__name__ == '__main__'`` 来检查 ;以及"
39
39
40
40
#: ../../library/__main__.rst:14
41
41
msgid "the ``__main__.py`` file in Python packages."
42
- msgstr "Python 包中的 ``__main__.py`` 文件 。"
42
+ msgstr "Python 包中的文件 ``__main__.py``。"
43
43
44
44
#: ../../library/__main__.rst:16
45
45
msgid ""
@@ -48,8 +48,8 @@ msgid ""
48
48
"detail below. If you're new to Python modules, see the tutorial section "
49
49
":ref:`tut-modules` for an introduction."
50
50
msgstr ""
51
- "这两种机制都有 Python 模块有关;用户如何与它们交互以及它们之间如何交互。 下文将进行详细说明。 如果你还不了解 Python 模块,请查看教程 "
52
- ":ref:`tut-modules` 一节的介绍 。"
51
+ "这两个机制都与 Python 模块相关——用户与它们如何交互,及它们之间如何交互——下文详述。而教程的 :ref:`tut-modules` "
52
+ "一节则为初学者介绍了 Python 模块 。"
53
53
54
54
#: ../../library/__main__.rst:25
55
55
msgid "``__name__ == '__main__'``"
@@ -61,24 +61,23 @@ msgid ""
61
61
"module's name. Usually, this is the name of the Python file itself without "
62
62
"the ``.py`` extension::"
63
63
msgstr ""
64
- "当一个 Python 模块或包被导入时,``__name__`` 会被设为模块的名称。 通常,这将是 Python 文件本身的名称去掉 ``.py`` "
65
- "后缀::"
64
+ "当一个 Python 模块或包被导入时,``__name__`` 被设为模块的名称——通常为 Python 文件本身的名称去掉 ``.py`` 后缀:"
66
65
67
66
#: ../../library/__main__.rst:35
68
67
msgid ""
69
68
"If the file is part of a package, ``__name__`` will also include the parent "
70
69
"package's path::"
71
- msgstr "如果文件是包的组成部分 ,则 ``__name__`` 还将包括父包的路径:: "
70
+ msgstr "如果文件是包的一部分 ,则 ``__name__`` 还将包括父包的路径: "
72
71
73
72
#: ../../library/__main__.rst:42
74
73
msgid ""
75
74
"However, if the module is executed in the top-level code environment, its "
76
75
"``__name__`` is set to the string ``'__main__'``."
77
- msgstr "不过,如果模块是在最高层级代码环境中执行的,则它的 ``__name__`` 会被设为字符串 ``'__main__'``。"
76
+ msgstr "而若模块是在顶层代码环境中执行的,则其 ``__name__`` 被设为字符串 ``'__main__'``。"
78
77
79
78
#: ../../library/__main__.rst:46
80
79
msgid "What is the \" top-level code environment\" ?"
81
- msgstr "什么是“最高层级代码环境 ”?"
80
+ msgstr "什么是“顶层代码环境 ”?"
82
81
83
82
#: ../../library/__main__.rst:48
84
83
msgid ""
@@ -88,61 +87,59 @@ msgid ""
88
87
"program needs. Sometimes \" top-level code\" is called an *entry point* to "
89
88
"the application."
90
89
msgstr ""
91
- "``__main__`` 是最高层级代码运行所在环境的名称。 “最高层级代码”即用户指定最先启动运行的 Python 模块。 "
92
- "它被称为“最高层级”是因为它将导入程序所需的所有其他模块。 有时“最高层级代码”也被称为应用的 *入口点*。"
90
+ "``__main__`` 是顶层代码运行环境的名称。“顶层代码”是指由用户指定的最先开始运行的那一个 Python "
91
+ "模块。之所以它是“顶层”,是因为它将导入程序所需的所有其它模块。 有时“顶层代码”被称为应用程序的 *入口点*。"
93
92
94
93
#: ../../library/__main__.rst:53
95
94
msgid "The top-level code environment can be:"
96
- msgstr "最高层级代码环境可以是: "
95
+ msgstr "顶层代码环境可以是: "
97
96
98
97
#: ../../library/__main__.rst:55
99
98
msgid "the scope of an interactive prompt::"
100
- msgstr "一个交互提示符的作用域:: "
99
+ msgstr "交互提示符的作用域: "
101
100
102
101
#: ../../library/__main__.rst:60
103
102
msgid "the Python module passed to the Python interpreter as a file argument:"
104
- msgstr "作为文件参数传给 Python 解释器的 Python 模块: "
103
+ msgstr "作为文件参数传给 Python 解释器的 Python 模块: "
105
104
106
105
#: ../../library/__main__.rst:67
107
106
msgid ""
108
107
"the Python module or package passed to the Python interpreter with the "
109
108
":option:`-m` argument:"
110
- msgstr "作为 :option:`-m` 参数传给 Python 解释器的 Python 模块或包: "
109
+ msgstr "与 :option:`-m` 一起传给 Python 解释器的 Python 模块或包: "
111
110
112
111
#: ../../library/__main__.rst:75
113
112
msgid "Python code read by the Python interpreter from standard input:"
114
- msgstr "Python 解释器从标准输入中读取的 Python 代码: "
113
+ msgstr "Python 解释器从标准输入中读取的 Python 代码: "
115
114
116
115
#: ../../library/__main__.rst:86
117
116
msgid ""
118
117
"Python code passed to the Python interpreter with the :option:`-c` argument:"
119
- msgstr "作为 :option:`-c` 参数传递给 Python 解释器的 Python 代码: "
118
+ msgstr "与 :option:`-c` 一起传给 Python 解释器的 Python 代码: "
120
119
121
120
#: ../../library/__main__.rst:97
122
121
msgid ""
123
122
"In each of these situations, the top-level module's ``__name__`` is set to "
124
123
"``'__main__'``."
125
- msgstr "在以上每个情形中,顶级模块的 ``__name__`` 被设置为 ``'__main__'`` 。"
124
+ msgstr "上述每种情况中的顶层模块的 ``__name__`` 被设为 ``'__main__'``。"
126
125
127
126
#: ../../library/__main__.rst:100
128
127
msgid ""
129
128
"As a result, a module can discover whether or not it is running in the top-"
130
129
"level environment by checking its own ``__name__``, which allows a common "
131
130
"idiom for conditionally executing code when the module is not initialized "
132
131
"from an import statement::"
133
- msgstr ""
134
- "因此,一个模块可以通过检查自己的 ``__name__`` "
135
- ",来发现它是否在顶层环境中运行。这是允许在模块没有从导入语句中初始化的情况下,有条件地执行代码的一个常见的语句::"
132
+ msgstr "作为结果,模块通过检查自己的 ``__name__`` 可发现自己是否运行于顶层环境,使一些代码仅当模块不是被导入语句初始化的时候才执行:"
136
133
137
134
#: ../../library/__main__.rst:111
138
135
msgid ""
139
136
"For a more detailed look at how ``__name__`` is set in all situations, see "
140
137
"the tutorial section :ref:`tut-modules`."
141
- msgstr "关于在所有情况下 ``__name__`` 是如何设置的细节,请看教程部分 :ref:`tut-modules` 。"
138
+ msgstr "关于在所有情况下 ``__name__`` 是被如何设置的,详见教程的 :ref:`tut-modules` 一节 。"
142
139
143
140
#: ../../library/__main__.rst:116 ../../library/__main__.rst:239
144
141
msgid "Idiomatic Usage"
145
- msgstr "常见用法 "
142
+ msgstr "惯用法 "
146
143
147
144
#: ../../library/__main__.rst:118
148
145
msgid ""
0 commit comments