@@ -1309,13 +1309,15 @@ msgid ""
1309
1309
"class can get very complicated if you're trying to modify the document "
1310
1310
"structure in some elaborate way."
1311
1311
msgstr ""
1312
+ "事件驱动方法的优点是整个文档不必同时驻留在内存中,这在处理非常大的文档时尤其重要。然而,如果你试图以某种复杂的方式修改文档结构,编写 SAX "
1313
+ "处理程序类可能会变得非常复杂。"
1312
1314
1313
1315
#: ../../whatsnew/2.0.rst:912
1314
1316
msgid ""
1315
1317
"For example, this little example program defines a handler that prints a "
1316
1318
"message for every starting and ending tag, and then parses the file "
1317
1319
":file:`hamlet.xml` using it::"
1318
- msgstr ""
1320
+ msgstr "例如,这个小示例程序定义了一个处理器,它为每个开始和结束标签打印一条消息,然后使用它来解析文件 :file:`hamlet.xml`:: "
1319
1321
1320
1322
#: ../../whatsnew/2.0.rst:935
1321
1323
msgid ""
@@ -1348,6 +1350,8 @@ msgid ""
1348
1350
"producing XML output than simply writing ``<tag1>``...\\ ``</tag1>`` to a "
1349
1351
"file."
1350
1352
msgstr ""
1353
+ "DOM 在修改 XML 文档方面非常有用,因为你可以创建一个 DOM 树,通过添加新节点或重新排列子树来修改它,然后生成一个新的 XML "
1354
+ "文档作为输出。你还可以手动构建一个 DOM 树并将其转换为 XML,这比简单地将``<tag1>``...\\ ``</tag1>``写入文件更灵活。"
1351
1355
1352
1356
#: ../../whatsnew/2.0.rst:956
1353
1357
msgid ""
@@ -1372,14 +1376,15 @@ msgstr ""
1372
1376
1373
1377
#: ../../whatsnew/2.0.rst:977
1374
1378
msgid "For the *Hamlet* XML file, the above few lines output::"
1375
- msgstr ""
1379
+ msgstr "对于 *Hamlet* XML 文件,上面几行代码输出:: "
1376
1380
1377
1381
#: ../../whatsnew/2.0.rst:982
1378
1382
msgid ""
1379
1383
"The root element of the document is available as ``doc.documentElement``, "
1380
1384
"and its children can be easily modified by deleting, adding, or removing "
1381
1385
"nodes::"
1382
1386
msgstr ""
1387
+ "文件的根元素可以通过 ``doc.documentElement`` 访问,并且可以通过删除、添加或一处节点来听松修改节点来轻松修改其子元素::"
1383
1388
1384
1389
#: ../../whatsnew/2.0.rst:997
1385
1390
msgid ""
@@ -1412,6 +1417,10 @@ msgid ""
1412
1417
" a strict superset of the standard package, adding a bunch of additional "
1413
1418
"features. Some of the additional features in PyXML include:"
1414
1419
msgstr ""
1420
+ "答案是 Python 2.0 的 :mod:`xml` 包与 PyXML 不兼容,但可以通过安装最新版本的 PyXML 来使其兼容。 "
1421
+ "许多应用程序可以依赖 Python 2.0 中包含的 XML 支持,但更复杂的应用程序需要安装完整的 PyXML 包。 安装后,版本为 0.6.0 "
1422
+ "或更高的 PyXML 将替换随 Python 一起发布的 :mod:`xml` 包,并且将是标准包的严格超集,添加许多额外的功能。 PyXML "
1423
+ "中的一些附加功能包括:"
1415
1424
1416
1425
#: ../../whatsnew/2.0.rst:1019
1417
1426
msgid "4DOM, a full DOM implementation from FourThought, Inc."
@@ -1477,6 +1486,9 @@ msgid ""
1477
1486
" operating systems that only have BSD curses, but there don't seem to be any"
1478
1487
" currently maintained OSes that fall into this category."
1479
1488
msgstr ""
1489
+ ":mod:`curses` 模块在 Oliver Andrich 增强版本的基础上得到了极大的扩展,提供了许多来自 ncurses 和 SYSV "
1490
+ "curses 的附加功能,如颜色、替代字符集支持、手写板和鼠标支持等。 这意味着该模块不再兼容仅有 BSD curses "
1491
+ "的操作系统,但目前似乎没有任何属于这一类别的操作系统正在维护中。"
1480
1492
1481
1493
#: ../../whatsnew/2.0.rst:1064
1482
1494
msgid ""
@@ -1486,6 +1498,8 @@ msgid ""
1486
1498
"written by Fredrik Lundh and partially funded by Hewlett Packard, supports "
1487
1499
"matching against both 8-bit strings and Unicode strings."
1488
1500
msgstr ""
1501
+ "如前面讨论的 Python 2.0 对 Unicode 的支持所提到的,:mod:`re` 模块提供的正则表达式的底层实现已经更改。 "
1502
+ "SRE,一个新的正则表达式引擎,由 Ferdrik Lundh 编写,部分由惠普资助,支持匹配 8 位字符串和 Unicode 字符串。"
1489
1503
1490
1504
#: ../../whatsnew/2.0.rst:1074
1491
1505
msgid "New modules"
@@ -1496,7 +1510,7 @@ msgid ""
1496
1510
"A number of new modules were added. We'll simply list them with brief "
1497
1511
"descriptions; consult the 2.0 documentation for the details of a particular "
1498
1512
"module."
1499
- msgstr ""
1513
+ msgstr "添加了许多新模块,我们将简单列出它们并附上简要概述;有关特定模块的详细信息,请查阅 2.0 文档。 "
1500
1514
1501
1515
#: ../../whatsnew/2.0.rst:1080
1502
1516
msgid ""
@@ -1506,6 +1520,9 @@ msgid ""
1506
1520
":mod:`atexit` and calling :func:`atexit.register` with the function to be "
1507
1521
"called on exit. (Contributed by Skip Montanaro.)"
1508
1522
msgstr ""
1523
+ ":mod:`atexit` 模块用于注册在 Python 解释器退出之前调用的函数。当前直接设置 ``sys.exitfunc`` 的代码应改为使用 "
1524
+ ":mod:`atexit` 模块,导入 :mod:`atexit` 并使用 :func:`atexit.register` 调用要在退出时调用的函数。 "
1525
+ "(由 Skip Montanaro 贡献。)"
1509
1526
1510
1527
#: ../../whatsnew/2.0.rst:1086
1511
1528
msgid ""
@@ -1528,6 +1545,9 @@ msgid ""
1528
1545
"separate contributions by Martin von Löwis, Peter Funk, and James "
1529
1546
"Henstridge.)"
1530
1547
msgstr ""
1548
+ ":mod:`gettext`: 这个模块通过提供 GNU gettext 消息目录库的接口,为 Python "
1549
+ "程序提供国际化(I18N)和本地化(L10N)支持。 (由 Barry Warsaw 整合,来自 Martin von Löwis, Peter "
1550
+ "Funk 和 James Henstridge 的独立贡献。)"
1531
1551
1532
1552
#: ../../whatsnew/2.0.rst:1098
1533
1553
msgid ""
@@ -1545,6 +1565,9 @@ msgid ""
1545
1565
"the :mod:`re` module. (Contributed by Sam Rushing, with some extensions by "
1546
1566
"A.M. Kuchling.)"
1547
1567
msgstr ""
1568
+ ":mod:`mmap`: 提供对内存映射文件的接口,支持 Windows 和 "
1569
+ "Unix。文件的内容可以直接映射到内存中,此时它表现得像一个可变字符串,因此可以读取和修改其内容。它们甚至可以传递给期望普通字符串的函数,例如 "
1570
+ ":mod:`re` 模块。(由 Sam Rushing 贡献,并由 A.M. Kuchling 提供一些扩展。)"
1548
1571
1549
1572
#: ../../whatsnew/2.0.rst:1108
1550
1573
msgid ""
@@ -1565,7 +1588,7 @@ msgstr ""
1565
1588
msgid ""
1566
1589
":mod:`tabnanny`: A module/script to check Python source code for ambiguous "
1567
1590
"indentation. (Contributed by Tim Peters.)"
1568
- msgstr ""
1591
+ msgstr ":mod:`tabnanny`: 一个模块/脚本,用于检查 Python 源代码中不歧义的缩进。 (由 Tim Peters 贡献。) "
1569
1592
1570
1593
#: ../../whatsnew/2.0.rst:1120
1571
1594
msgid ""
@@ -1584,6 +1607,10 @@ msgid ""
1584
1607
":file:`Tools/idle/BrowserControl.py`, and adapted for the standard library "
1585
1608
"by Fred.)"
1586
1609
msgstr ""
1610
+ ":mod:`webbrowser` 模块提供了一种平台独立的方式来在特定 URL 上启动 web "
1611
+ "浏览器。对于每个平台,模块会按特定顺序尝试各种浏览器。用户可以通过设置 *BROWSER* 环境变量来更改启动的浏览器。(最初的灵感来自 Eric S."
1612
+ " Raymond 对 :mod:`urllib` 的补丁,该补丁增加了类似的功能,但最终的模块来自 Fred Drake 最初实现的代码 "
1613
+ ":file:`Tools/idle/BrowserControl.py`,并由 Fred 适配到标准库中。)"
1587
1614
1588
1615
#: ../../whatsnew/2.0.rst:1132
1589
1616
msgid ""
@@ -1600,6 +1627,9 @@ msgid ""
1600
1627
"on Unix, not to be confused with :program:`gzip`\\ -format files (which are "
1601
1628
"supported by the :mod:`gzip` module) (Contributed by James C. Ahlstrom.)"
1602
1629
msgstr ""
1630
+ ":mod:`zipfile` 模块:用于读取和写入 ZIP 格式的归档文件。 这些归档文件是由 DOS/Windows 上的 "
1631
+ ":program:`PKZIP` 或 Unix 上的 :program:`zip` 生成的,不要与 :program:`gzip` 格式文件(由 "
1632
+ ":mod:`gzip` 支持)混淆。 (由 James C. Ahlstrom 贡献。)"
1603
1633
1604
1634
#: ../../whatsnew/2.0.rst:1142
1605
1635
msgid ""
@@ -1638,13 +1668,13 @@ msgstr "类浏览器现在将显示更多信息,例如一个模块中最高层
1638
1668
msgid ""
1639
1669
"Tab width is now a user settable option. When opening an existing Python "
1640
1670
"file, IDLE automatically detects the indentation conventions, and adapts."
1641
- msgstr ""
1671
+ msgstr "制表符宽度现在是一个用户可设置的选项。在打开现有的 Python 文件时,IDLE 会自动检测缩进约定并进行适应。 "
1642
1672
1643
1673
#: ../../whatsnew/2.0.rst:1165
1644
1674
msgid ""
1645
1675
"There is now support for calling browsers on various platforms, used to open"
1646
1676
" the Python documentation in a browser."
1647
- msgstr ""
1677
+ msgstr "现在支持在各种平台上调用浏览器,用于在浏览器中打开 Python 文档。 "
1648
1678
1649
1679
#: ../../whatsnew/2.0.rst:1168
1650
1680
msgid ""
@@ -1669,6 +1699,7 @@ msgid ""
1669
1699
"Three new keystroke commands: Check module (:kbd:`Alt-F5`), Import module "
1670
1700
"(:kbd:`F5`) and Run script (:kbd:`Ctrl-F5`)."
1671
1701
msgstr ""
1702
+ "三个新的键盘快捷键:检查模块 (:kbd:`Alt-F5`),导入模块 (:kbd:`F5`) 和执行脚本 (:kbd:`Ctrl-F5`)。"
1672
1703
1673
1704
#: ../../whatsnew/2.0.rst:1184
1674
1705
msgid "Deleted and Deprecated Modules"
0 commit comments