@@ -547,6 +547,8 @@ msgid ""
547547"the default behaviour of the installer) or you should bundle your "
548548"application with the embedded distribution."
549549msgstr ""
550+ "若要如上所述发布一个 Windows 可执行文件,就得确保用户在 PATH 中包含``python3.dll`` "
551+ "的路径(安装程序默认不会如此),或者应把应用程序与内嵌版 Python 一起打包。"
550552
551553#: ../../library/zipapp.rst:408
552554msgid ""
@@ -558,10 +560,13 @@ msgid ""
558560":func:`multiprocessing.set_executable` to let the module know where to find "
559561"the standard Python interpreter."
560562msgstr ""
563+ "上述给出的启动程序采用了 Python 嵌入 API。 这意味着应用程序将会是 ``sys.executable`` ,而*不是*传统的 Python "
564+ "解释器。代码及依赖项需做好准备。例如,如果应用程序用到了 :mod:`multiprocessing` 模块,就需要调用 "
565+ ":func:`multiprocessing.set_executable` 来让模块知道标准 Python 解释器的位置。"
561566
562567#: ../../library/zipapp.rst:418
563568msgid "The Python Zip Application Archive Format"
564- msgstr ""
569+ msgstr "Python 打包应用程序的格式 "
565570
566571#: ../../library/zipapp.rst:420
567572msgid ""
@@ -573,17 +578,22 @@ msgid ""
573578"will be placed on :data:`sys.path` and thus further modules can be imported "
574579"from the zip file."
575580msgstr ""
581+ "自 2.6 版开始,Python 即能够执行包含 文件的打包文件了。为了能被 Python 执行,应用程序的打包文件必须为包含 "
582+ "``__main__.py`` 文件的标准 zip 文件,``__main__.py`` 文件将作为应用程序的入口运行。类似于常规的 Python "
583+ "脚本,父级(这里指打包文件)将放入 :data:`sys.path` ,因此可从打包文件中导入更多的模块。"
576584
577585#: ../../library/zipapp.rst:427
578586msgid ""
579587"The zip file format allows arbitrary data to be prepended to a zip file. "
580588"The zip application format uses this ability to prepend a standard POSIX "
581589"\" shebang\" line to the file (``#!/path/to/interpreter``)."
582590msgstr ""
591+ "zip 文件格式允许在文件中预置任意数据。利用这种能力,zip 应用程序格式在文件中预置了一个标准的 POSIX "
592+ "“释伴”行(``#!/path/to/interpreter``)。"
583593
584594#: ../../library/zipapp.rst:431
585595msgid "Formally, the Python zip application format is therefore:"
586- msgstr ""
596+ msgstr "因此,Python zip 应用程序的格式会如下所示: "
587597
588598#: ../../library/zipapp.rst:433
589599msgid ""
@@ -594,6 +604,9 @@ msgid ""
594604"encoded in UTF-8 on Windows, and in :func:`sys.getfilesystemencoding()` on "
595605"POSIX."
596606msgstr ""
607+ "可选的释伴行,包含字符 ``b'#!'``,后面是解释器名,然后是换行符 (``b'\\ n'``)。 解释器名可为操作系统 "
608+ "“释伴”处理所能接受的任意值,或为 Windows 系统中的 Python 启动程序。解释器名在 Windows 中应用 UTF-8 编码,在 "
609+ "POSIX 中则用 :func:`sys.getfilesystemencoding()`。"
597610
598611#: ../../library/zipapp.rst:438
599612msgid ""
@@ -602,6 +615,8 @@ msgid ""
602615"in the \" root\" of the zipfile - i.e., it cannot be in a subdirectory). The"
603616" zipfile data can be compressed or uncompressed."
604617msgstr ""
618+ "标准的打包文件由 :mod:`zipfile` 模块生成。其中 *必须* 包含一个名为``__main__.py`` "
619+ "的文件(必须位于打包文件的“根”目录——不能位于某个子目录中)。打包文件中的数据可以是压缩或未压缩的。"
605620
606621#: ../../library/zipapp.rst:443
607622msgid ""
0 commit comments