@@ -306,7 +306,7 @@ msgstr "要让应用程序能在 POSIX 平台上直接执行,需要指定所
306306msgid ""
307307"To replace the shebang line on an existing archive, create a modified "
308308"archive using the :func:`create_archive` function::"
309- msgstr ""
309+ msgstr "若要替换已有打包文件中的释伴行,请用 :func:`create_archive` 函数另建一个修改好的打包文件: "
310310
311311#: ../../library/zipapp.rst:218
312312msgid ""
@@ -317,10 +317,12 @@ msgid ""
317317" such errors, but production code should do so. Also, this method will only"
318318" work if the archive fits in memory::"
319319msgstr ""
320+ "若要原地更新打包文件,可用 :class:`BytesIO` "
321+ "对象在内存中进行替换,然后再覆盖源文件。注意,原地覆盖文件会有风险,出错时会丢失原文件。这里没有考虑出错情况,但生产代码则应进行处理。另外,这种方案仅当内存足以容纳打包文件时才有意义:"
320322
321323#: ../../library/zipapp.rst:236
322324msgid "Specifying the Interpreter"
323- msgstr ""
325+ msgstr "指定解释器程序 "
324326
325327#: ../../library/zipapp.rst:238
326328msgid ""
@@ -329,6 +331,8 @@ msgid ""
329331"Python launcher for Windows supports most common forms of POSIX ``#!`` line,"
330332" but there are other issues to consider:"
331333msgstr ""
334+ "注意,如果指定了解释器程序再发布应用程序打包文件,需要确保所用到的解释器是可移植的。Windows 的 Python 启动器支持大多数常见的 POSIX"
335+ " ``#!`` 行,但还需要考虑一些其他问题。"
332336
333337#: ../../library/zipapp.rst:243
334338msgid ""
@@ -337,13 +341,18 @@ msgid ""
337341"may have either Python 2 or Python 3 as their default, and write your code "
338342"to work under both versions."
339343msgstr ""
344+ "如果采用“/usr/bin/env python”(或其他格式的 python "
345+ "调用命令,比如“/usr/bin/python”),需要考虑默认版本既可能是 Python 2 又可能是 Python "
346+ "3,应让代码在两个版本下均能正常运行。"
340347
341348#: ../../library/zipapp.rst:247
342349msgid ""
343350"If you use an explicit version, for example \" /usr/bin/env python3\" your "
344351"application will not work for users who do not have that version. (This may"
345352" be what you want if you have not made your code Python 2 compatible)."
346353msgstr ""
354+ "如果用到的 Python 版本明确,如“/usr/bin/env python3”,则没有该版本的用户将无法运行应用程序。(如果代码不兼容 Python"
355+ " 2,可能正该如此)。"
347356
348357#: ../../library/zipapp.rst:250
349358msgid ""
0 commit comments