@@ -1309,13 +1309,15 @@ msgid ""
13091309"class can get very complicated if you're trying to modify the document "
13101310"structure in some elaborate way."
13111311msgstr ""
1312+ "事件驱动方法的优点是整个文档不必同时驻留在内存中,这在处理非常大的文档时尤其重要。然而,如果你试图以某种复杂的方式修改文档结构,编写 SAX "
1313+ "处理程序类可能会变得非常复杂。"
13121314
13131315#: ../../whatsnew/2.0.rst:912
13141316msgid ""
13151317"For example, this little example program defines a handler that prints a "
13161318"message for every starting and ending tag, and then parses the file "
13171319":file:`hamlet.xml` using it::"
1318- msgstr ""
1320+ msgstr "例如,这个小示例程序定义了一个处理器,它为每个开始和结束标签打印一条消息,然后使用它来解析文件 :file:`hamlet.xml`:: "
13191321
13201322#: ../../whatsnew/2.0.rst:935
13211323msgid ""
@@ -1348,6 +1350,8 @@ msgid ""
13481350"producing XML output than simply writing ``<tag1>``...\\ ``</tag1>`` to a "
13491351"file."
13501352msgstr ""
1353+ "DOM 在修改 XML 文档方面非常有用,因为你可以创建一个 DOM 树,通过添加新节点或重新排列子树来修改它,然后生成一个新的 XML "
1354+ "文档作为输出。你还可以手动构建一个 DOM 树并将其转换为 XML,这比简单地将``<tag1>``...\\ ``</tag1>``写入文件更灵活。"
13511355
13521356#: ../../whatsnew/2.0.rst:956
13531357msgid ""
@@ -1372,14 +1376,15 @@ msgstr ""
13721376
13731377#: ../../whatsnew/2.0.rst:977
13741378msgid "For the *Hamlet* XML file, the above few lines output::"
1375- msgstr ""
1379+ msgstr "对于 *Hamlet* XML 文件,上面几行代码输出:: "
13761380
13771381#: ../../whatsnew/2.0.rst:982
13781382msgid ""
13791383"The root element of the document is available as ``doc.documentElement``, "
13801384"and its children can be easily modified by deleting, adding, or removing "
13811385"nodes::"
13821386msgstr ""
1387+ "文件的根元素可以通过 ``doc.documentElement`` 访问,并且可以通过删除、添加或一处节点来听松修改节点来轻松修改其子元素::"
13831388
13841389#: ../../whatsnew/2.0.rst:997
13851390msgid ""
@@ -1412,6 +1417,10 @@ msgid ""
14121417" a strict superset of the standard package, adding a bunch of additional "
14131418"features. Some of the additional features in PyXML include:"
14141419msgstr ""
1420+ "答案是 Python 2.0 的 :mod:`xml` 包与 PyXML 不兼容,但可以通过安装最新版本的 PyXML 来使其兼容。 "
1421+ "许多应用程序可以依赖 Python 2.0 中包含的 XML 支持,但更复杂的应用程序需要安装完整的 PyXML 包。 安装后,版本为 0.6.0 "
1422+ "或更高的 PyXML 将替换随 Python 一起发布的 :mod:`xml` 包,并且将是标准包的严格超集,添加许多额外的功能。 PyXML "
1423+ "中的一些附加功能包括:"
14151424
14161425#: ../../whatsnew/2.0.rst:1019
14171426msgid "4DOM, a full DOM implementation from FourThought, Inc."
@@ -1477,6 +1486,9 @@ msgid ""
14771486" operating systems that only have BSD curses, but there don't seem to be any"
14781487" currently maintained OSes that fall into this category."
14791488msgstr ""
1489+ ":mod:`curses` 模块在 Oliver Andrich 增强版本的基础上得到了极大的扩展,提供了许多来自 ncurses 和 SYSV "
1490+ "curses 的附加功能,如颜色、替代字符集支持、手写板和鼠标支持等。 这意味着该模块不再兼容仅有 BSD curses "
1491+ "的操作系统,但目前似乎没有任何属于这一类别的操作系统正在维护中。"
14801492
14811493#: ../../whatsnew/2.0.rst:1064
14821494msgid ""
@@ -1486,6 +1498,8 @@ msgid ""
14861498"written by Fredrik Lundh and partially funded by Hewlett Packard, supports "
14871499"matching against both 8-bit strings and Unicode strings."
14881500msgstr ""
1501+ "如前面讨论的 Python 2.0 对 Unicode 的支持所提到的,:mod:`re` 模块提供的正则表达式的底层实现已经更改。 "
1502+ "SRE,一个新的正则表达式引擎,由 Ferdrik Lundh 编写,部分由惠普资助,支持匹配 8 位字符串和 Unicode 字符串。"
14891503
14901504#: ../../whatsnew/2.0.rst:1074
14911505msgid "New modules"
@@ -1496,7 +1510,7 @@ msgid ""
14961510"A number of new modules were added. We'll simply list them with brief "
14971511"descriptions; consult the 2.0 documentation for the details of a particular "
14981512"module."
1499- msgstr ""
1513+ msgstr "添加了许多新模块,我们将简单列出它们并附上简要概述;有关特定模块的详细信息,请查阅 2.0 文档。 "
15001514
15011515#: ../../whatsnew/2.0.rst:1080
15021516msgid ""
@@ -1506,6 +1520,9 @@ msgid ""
15061520":mod:`atexit` and calling :func:`atexit.register` with the function to be "
15071521"called on exit. (Contributed by Skip Montanaro.)"
15081522msgstr ""
1523+ ":mod:`atexit` 模块用于注册在 Python 解释器退出之前调用的函数。当前直接设置 ``sys.exitfunc`` 的代码应改为使用 "
1524+ ":mod:`atexit` 模块,导入 :mod:`atexit` 并使用 :func:`atexit.register` 调用要在退出时调用的函数。 "
1525+ "(由 Skip Montanaro 贡献。)"
15091526
15101527#: ../../whatsnew/2.0.rst:1086
15111528msgid ""
@@ -1528,6 +1545,9 @@ msgid ""
15281545"separate contributions by Martin von Löwis, Peter Funk, and James "
15291546"Henstridge.)"
15301547msgstr ""
1548+ ":mod:`gettext`: 这个模块通过提供 GNU gettext 消息目录库的接口,为 Python "
1549+ "程序提供国际化(I18N)和本地化(L10N)支持。 (由 Barry Warsaw 整合,来自 Martin von Löwis, Peter "
1550+ "Funk 和 James Henstridge 的独立贡献。)"
15311551
15321552#: ../../whatsnew/2.0.rst:1098
15331553msgid ""
@@ -1545,6 +1565,9 @@ msgid ""
15451565"the :mod:`re` module. (Contributed by Sam Rushing, with some extensions by "
15461566"A.M. Kuchling.)"
15471567msgstr ""
1568+ ":mod:`mmap`: 提供对内存映射文件的接口,支持 Windows 和 "
1569+ "Unix。文件的内容可以直接映射到内存中,此时它表现得像一个可变字符串,因此可以读取和修改其内容。它们甚至可以传递给期望普通字符串的函数,例如 "
1570+ ":mod:`re` 模块。(由 Sam Rushing 贡献,并由 A.M. Kuchling 提供一些扩展。)"
15481571
15491572#: ../../whatsnew/2.0.rst:1108
15501573msgid ""
@@ -1565,7 +1588,7 @@ msgstr ""
15651588msgid ""
15661589":mod:`tabnanny`: A module/script to check Python source code for ambiguous "
15671590"indentation. (Contributed by Tim Peters.)"
1568- msgstr ""
1591+ msgstr ":mod:`tabnanny`: 一个模块/脚本,用于检查 Python 源代码中不歧义的缩进。 (由 Tim Peters 贡献。) "
15691592
15701593#: ../../whatsnew/2.0.rst:1120
15711594msgid ""
@@ -1584,6 +1607,10 @@ msgid ""
15841607":file:`Tools/idle/BrowserControl.py`, and adapted for the standard library "
15851608"by Fred.)"
15861609msgstr ""
1610+ ":mod:`webbrowser` 模块提供了一种平台独立的方式来在特定 URL 上启动 web "
1611+ "浏览器。对于每个平台,模块会按特定顺序尝试各种浏览器。用户可以通过设置 *BROWSER* 环境变量来更改启动的浏览器。(最初的灵感来自 Eric S."
1612+ " Raymond 对 :mod:`urllib` 的补丁,该补丁增加了类似的功能,但最终的模块来自 Fred Drake 最初实现的代码 "
1613+ ":file:`Tools/idle/BrowserControl.py`,并由 Fred 适配到标准库中。)"
15871614
15881615#: ../../whatsnew/2.0.rst:1132
15891616msgid ""
@@ -1600,6 +1627,9 @@ msgid ""
16001627"on Unix, not to be confused with :program:`gzip`\\ -format files (which are "
16011628"supported by the :mod:`gzip` module) (Contributed by James C. Ahlstrom.)"
16021629msgstr ""
1630+ ":mod:`zipfile` 模块:用于读取和写入 ZIP 格式的归档文件。 这些归档文件是由 DOS/Windows 上的 "
1631+ ":program:`PKZIP` 或 Unix 上的 :program:`zip` 生成的,不要与 :program:`gzip` 格式文件(由 "
1632+ ":mod:`gzip` 支持)混淆。 (由 James C. Ahlstrom 贡献。)"
16031633
16041634#: ../../whatsnew/2.0.rst:1142
16051635msgid ""
@@ -1638,13 +1668,13 @@ msgstr "类浏览器现在将显示更多信息,例如一个模块中最高层
16381668msgid ""
16391669"Tab width is now a user settable option. When opening an existing Python "
16401670"file, IDLE automatically detects the indentation conventions, and adapts."
1641- msgstr ""
1671+ msgstr "制表符宽度现在是一个用户可设置的选项。在打开现有的 Python 文件时,IDLE 会自动检测缩进约定并进行适应。 "
16421672
16431673#: ../../whatsnew/2.0.rst:1165
16441674msgid ""
16451675"There is now support for calling browsers on various platforms, used to open"
16461676" the Python documentation in a browser."
1647- msgstr ""
1677+ msgstr "现在支持在各种平台上调用浏览器,用于在浏览器中打开 Python 文档。 "
16481678
16491679#: ../../whatsnew/2.0.rst:1168
16501680msgid ""
@@ -1669,6 +1699,7 @@ msgid ""
16691699"Three new keystroke commands: Check module (:kbd:`Alt-F5`), Import module "
16701700"(:kbd:`F5`) and Run script (:kbd:`Ctrl-F5`)."
16711701msgstr ""
1702+ "三个新的键盘快捷键:检查模块 (:kbd:`Alt-F5`),导入模块 (:kbd:`F5`) 和执行脚本 (:kbd:`Ctrl-F5`)。"
16721703
16731704#: ../../whatsnew/2.0.rst:1184
16741705msgid "Deleted and Deprecated Modules"
0 commit comments