1111# Zhe He <[email protected] >, 20191212# ChenYuan <[email protected] >, 20191313# ppcfish <[email protected] >, 201914- # Meng Du <[email protected] >, 20191514# Siyuan Xu <[email protected] >, 201915+ # Meng Du <[email protected] >, 20191616#
1717#, fuzzy
1818msgid ""
@@ -21,7 +21,7 @@ msgstr ""
2121"Report-Msgid-Bugs-To : \n "
2222"POT-Creation-Date : 2019-03-11 10:48+0900\n "
2323"PO-Revision-Date : 2017-02-16 17:43+0000\n "
24- "Last-Translator : Siyuan Xu <mf20070535@126 .com>, 2019\n "
24+ "Last-Translator : Meng Du <alphanow@gmail .com>, 2019\n "
2525"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2626"MIME-Version : 1.0\n "
2727"Content-Type : text/plain; charset=UTF-8\n "
@@ -180,6 +180,7 @@ msgid ""
180180"determine the set of modules required by a program and bind these modules "
181181"together with a Python binary to produce a single executable."
182182msgstr ""
183+ "如果你想要的只是一个独立的程序,用户可以下载和运行而不必先安装Python发行版,你就不需要将Python编译成C代码。有许多工具可以确定程序所需的模块集,并将这些模块与Python二进制文件绑定在一起以生成单个可执行文件。"
183184
184185#: ../../faq/programming.rst:89
185186msgid ""
@@ -188,6 +189,8 @@ msgid ""
188189"you can embed all your modules into a new program, which is then linked with"
189190" the standard Python modules."
190191msgstr ""
192+ "一种是使用冻结工具,它包含在Python源代码树 ``Tools/freeze`` "
193+ "中。它将Python字节代码转换为C数组;一个C编译器,你可以将所有模块嵌入到一个新程序中,然后将其与标准Python模块链接。"
191194
192195#: ../../faq/programming.rst:94
193196msgid ""
@@ -201,12 +204,15 @@ msgid ""
201204"with the rest of the Python interpreter to form a self-contained binary "
202205"which acts exactly like your script."
203206msgstr ""
207+ "它的工作原理是递归扫描源代码以获取import语句(两种形式),并在标准Python路径和源目录(用于内置模块)中查找模块。 "
208+ "然后,它将用Python编写的模块的字节码转换为C代码(可以使用编组模块转换为代码对象的数组初始化器),并创建一个定制的配置文件,该文件仅包含程序中实际使用的内置模块。"
209+ " 然后,它编译生成的C代码并将其与Python解释器的其余部分链接,以形成一个独立的二进制文件,其行为与你的脚本完全相同。"
204210
205211#: ../../faq/programming.rst:103
206212msgid ""
207213"Obviously, freeze requires a C compiler. There are several other utilities "
208214"which don't. One is Thomas Heller's py2exe (Windows only) at"
209- msgstr ""
215+ msgstr "显然, freeze 需要一个C编译器。有几个其他实用工具不需要。 一个是Thomas Heller的py2exe(仅限Windows) "
210216
211217#: ../../faq/programming.rst:106
212218msgid "http://www.py2exe.org/"
@@ -217,43 +223,45 @@ msgid ""
217223"Another tool is Anthony Tuininga's `cx_Freeze <https://anthony-"
218224"tuininga.github.io/cx_Freeze/>`_."
219225msgstr ""
226+ "另一个工具是 Anthony Tuininga 的 `cx_Freeze <https://anthony-"
227+ "tuininga.github.io/cx_Freeze/>`_。"
220228
221229#: ../../faq/programming.rst:112
222230msgid "Are there coding standards or a style guide for Python programs?"
223- msgstr ""
231+ msgstr "是否有编程标准或Python程序的样式指南? "
224232
225233#: ../../faq/programming.rst:114
226234msgid ""
227235"Yes. The coding style required for standard library modules is documented "
228236"as :pep:`8`."
229- msgstr ""
237+ msgstr "是。标准库模块所要求的编码样式文档为 :pep:`8` 。 "
230238
231239#: ../../faq/programming.rst:119
232240msgid "Core Language"
233- msgstr ""
241+ msgstr "核心语言 "
234242
235243#: ../../faq/programming.rst:122
236244msgid "Why am I getting an UnboundLocalError when the variable has a value?"
237- msgstr ""
245+ msgstr "当变量有值时,为什么会出现UnboundLocalError? "
238246
239247#: ../../faq/programming.rst:124
240248msgid ""
241249"It can be a surprise to get the UnboundLocalError in previously working code"
242250" when it is modified by adding an assignment statement somewhere in the body"
243251" of a function."
244- msgstr ""
252+ msgstr "通过在函数体中的某处添加赋值语句,导致以前正常工作的代码被修改而得到 UnboundLocalError 会令人感到意外。 "
245253
246254#: ../../faq/programming.rst:128
247255msgid "This code:"
248- msgstr ""
256+ msgstr "以下代码: "
249257
250258#: ../../faq/programming.rst:136
251259msgid "works, but this code:"
252- msgstr ""
260+ msgstr "正常工作,但是以下代码 "
253261
254262#: ../../faq/programming.rst:143
255263msgid "results in an UnboundLocalError:"
256- msgstr ""
264+ msgstr "会得到一个 UnboundLocalError : "
257265
258266#: ../../faq/programming.rst:150
259267msgid ""
@@ -264,25 +272,27 @@ msgid ""
264272"Consequently when the earlier ``print(x)`` attempts to print the "
265273"uninitialized local variable and an error results."
266274msgstr ""
275+ "这是因为当你对作用域中的变量进行赋值时,该变量将成为该作用域的局部变量,并在外部作用域中隐藏任何类似命名的变量。由于foo中的最后一个语句为 ``x``"
276+ " 分配了一个新值,编译器会将其识别为局部变量。因此,当先前的 ``print(x)`` 尝试打印未初始化的局部变量时会导致错误。"
267277
268278#: ../../faq/programming.rst:157
269279msgid ""
270280"In the example above you can access the outer scope variable by declaring it"
271281" global:"
272- msgstr ""
282+ msgstr "在上面的示例中,你可以通过将其声明为全局来访问外部作用域变量: "
273283
274284#: ../../faq/programming.rst:168
275285msgid ""
276286"This explicit declaration is required in order to remind you that (unlike "
277287"the superficially analogous situation with class and instance variables) you"
278288" are actually modifying the value of the variable in the outer scope:"
279- msgstr ""
289+ msgstr "这个显式声明是必需的,以便提醒你(与类和实例变量的表面类似情况不同),你实际上是在外部作用域中修改变量的值 "
280290
281291#: ../../faq/programming.rst:175
282292msgid ""
283293"You can do a similar thing in a nested scope using the :keyword:`nonlocal` "
284294"keyword:"
285- msgstr ""
295+ msgstr "你可以使用 :keyword:`nonlocal` 关键字在嵌套作用域中执行类似的操作: "
286296
287297#: ../../faq/programming.rst:192
288298msgid "What are the rules for local and global variables in Python?"
0 commit comments