@@ -304,22 +304,24 @@ msgstr ""
304304msgid ""
305305"I want to compile a Python module on my Linux system, but some files are "
306306"missing. Why?"
307- msgstr ""
307+ msgstr "我想在Linux系统上编译一个Python模块,但是缺少一些文件。为什么? "
308308
309309#: ../../faq/extending.rst:249
310310msgid ""
311311"Most packaged versions of Python don't include the "
312312":file:`/usr/lib/python2.{x}/config/` directory, which contains various files"
313313" required for compiling Python extensions."
314314msgstr ""
315+ "大多数打包的Python版本不包含 :file:`/usr/lib/python2.{x}/config/` "
316+ "目录,该目录中包含编译Python扩展所需的各种文件。"
315317
316318#: ../../faq/extending.rst:253
317319msgid "For Red Hat, install the python-devel RPM to get the necessary files."
318- msgstr ""
320+ msgstr "对于Red Hat,安装python-devel RPM以获取必要的文件。 "
319321
320322#: ../../faq/extending.rst:255
321323msgid "For Debian, run ``apt-get install python-dev``."
322- msgstr ""
324+ msgstr "对于Debian,运行 ``apt-get install python-dev`` 。 "
323325
324326#: ../../faq/extending.rst:259
325327msgid "How do I tell \" incomplete input\" from \" invalid input\" ?"
@@ -333,12 +335,13 @@ msgid ""
333335"parentheses or triple string quotes), but it gives you a syntax error "
334336"message immediately when the input is invalid."
335337msgstr ""
338+ "有时,希望模仿Python交互式解释器的行为,在输入不完整时(例如,您键入了“if”语句的开头,或者没有关闭括号或三个字符串引号),给出一个延续提示,但当输入无效时,立即给出一条语法错误消息。"
336339
337340#: ../../faq/extending.rst:267
338341msgid ""
339342"In Python you can use the :mod:`codeop` module, which approximates the "
340343"parser's behavior sufficiently. IDLE uses this, for example."
341- msgstr ""
344+ msgstr "在Python中,您可以使用 :mod:`codeop` 模块,该模块非常接近解析器的行为。例如,IDLE就使用了这个。 "
342345
343346#: ../../faq/extending.rst:270
344347msgid ""
@@ -348,6 +351,9 @@ msgid ""
348351"to point at your custom input function. See ``Modules/readline.c`` and "
349352"``Parser/myreadline.c`` for more hints."
350353msgstr ""
354+ "在C中执行此操作的最简单方法是调用 :c:func:`PyRun_InteractiveLoop` "
355+ "(可能在单独的线程中)并让Python解释器为您处理输入。您还可以设置 :c:func:`PyOS_ReadlineFunctionPointer` "
356+ "指向您的自定义输入函数。有关更多提示,请参阅 ``Modules/readline.c`` 和 ``Parser/myreadline.c`` 。"
351357
352358#: ../../faq/extending.rst:276
353359msgid ""
@@ -358,6 +364,9 @@ msgid ""
358364"``e.error`` equal to ``E_EOF``, which means the input is incomplete. Here's"
359365" a sample code fragment, untested, inspired by code from Alex Farber::"
360366msgstr ""
367+ "但是,有时必须在与其他应用程序相同的线程中运行嵌入式Python解释器,并且不能允许 :c:func:`PyRun_InteractiveLoop` "
368+ "在等待用户输入时停止。那么另一个解决方案是调用 :c:func:`PyParser_ParseString` 并测试 ``e.error`` 等于 "
369+ "``E_EOF`` ,如果等于,就意味着输入不完整。这是一个示例代码片段,未经测试,灵感来自Alex Farber的代码::"
361370
362371#: ../../faq/extending.rst:309
363372msgid ""
0 commit comments