@@ -822,6 +822,12 @@ msgid ""
822822"available to Python code as ``sys.prefix``. It is only useful on Unix. See "
823823"also the next function."
824824msgstr ""
825+ "返回针对已安装的独立于平台文件的 *prefix*。 这是通过基于使用 :c:func:`Py_SetProgramName` "
826+ "设置的程序名称和某些环境变量所派生的一系列复杂规则获得的;举例来说,如果程序名称为 ``'/usr/local/bin/python'``,则 "
827+ "prefix 为 ``'/usr/local'``。 返回的字符串将指向静态存储;调用方不应修改其值。 这对应于最高层级 "
828+ ":file:`Makefile` 中的 :makevar:`prefix` 变量以及在编译时传给 :program:`configure` 脚本的 "
829+ ":option:`--prefix` 参数。 该值将以 ``sys.prefix`` 的名称供 Python 代码使用。 它仅适用于 Unix。 "
830+ "另请参见下一个函数。"
825831
826832#: ../../c-api/init.rst:529
827833msgid ""
@@ -836,6 +842,12 @@ msgid ""
836842"time. The value is available to Python code as ``sys.exec_prefix``. It is "
837843"only useful on Unix."
838844msgstr ""
845+ "返回针对已安装的 *依赖于* 平台文件的 *exec-prefix*。 这是通过基于使用 :c:func:`Py_SetProgramName` "
846+ "设置的程序名称和某些环境变量所派生的一系列复杂规则获得的;举例来说,如果程序名称为 ``'/usr/local/bin/python'``,则 "
847+ "exec-prefix 为 ``'/usr/local'``。 返回的字符串将指向静态存储;调用方不应修改其值。 这对应于最高层级 "
848+ ":file:`Makefile` 中的 :makevar:`exec_prefix` 变量以及在编译时传给 :program:`configure` "
849+ "脚本的 ``--exec-prefix`` 参数。 该值将以 ``sys.exec_prefix`` 的名称供 Python 代码使用。 它仅适用于 "
850+ "Unix。"
839851
840852#: ../../c-api/init.rst:539
841853msgid ""
@@ -845,6 +857,9 @@ msgid ""
845857"files may be installed in the :file:`/usr/local/plat` subtree while platform"
846858" independent may be installed in :file:`/usr/local`."
847859msgstr ""
860+ "背景:当依赖于平台的文件(如可执行文件和共享库)是安装于不同的目录树中的时候 exec-prefix 将会不同于 prefix。 "
861+ "在典型的安装中,依赖于平台的文件可能安装于 the :file:`/usr/local/plat` 子目录树而独立于平台的文件可能安装于 "
862+ ":file:`/usr/local`。"
848863
849864#: ../../c-api/init.rst:545
850865msgid ""
@@ -859,6 +874,10 @@ msgid ""
859874"compiled Python bytecode files are platform independent (but not independent"
860875" from the Python version by which they were compiled!)."
861876msgstr ""
877+ "总而言之,平台是一组硬件和软件资源的组合,例如所有运行 Solaris 2.x 操作系统的 Sparc 机器会被视为相同平台,但运行 Solaris "
878+ "2.x 的 Intel 机器是另一种平台,而运行 Linux 的 Intel 机器又是另一种平台。 相同操作系统的不同主要发布版通常也会构成不同的平台。"
879+ " 非 Unix 操作系统的情况又有所不同;这类系统上的安装策略差别巨大因此 prefix 和 exec-prefix 是没有意义的,并将被设为空字符串。"
880+ " 请注意已编译的 Python 字节码是独立于平台的(但并不独立于它们编译时所使用的 Python 版本!)"
862881
863882#: ../../c-api/init.rst:556
864883msgid ""
@@ -867,6 +886,8 @@ msgid ""
867886"while having :file:`/usr/local/plat` be a different filesystem for each "
868887"platform."
869888msgstr ""
889+ "系统管理员知道如何配置 :program:`mount` 或 :program:`automount` 程序以在平台间共享 "
890+ ":file:`/usr/local` 而让 :file:`/usr/local/plat` 成为针对不同平台的不同文件系统。"
870891
871892#: ../../c-api/init.rst:574
872893msgid ""
@@ -876,6 +897,9 @@ msgid ""
876897"into static storage; the caller should not modify its value. The value is "
877898"available to Python code as ``sys.executable``."
878899msgstr ""
900+ "返回 Python 可执行文件的完整程序名称;这是作为根据程序名称(由上述 :c:func:`Py_SetProgramName` "
901+ "设置)派生默认模块搜索路径的附带影响计算得出的。 返回的字符串将指向静态存储;调用方不应修改其值。 该值将以 ``sys.executable`` "
902+ "的名称供 Python 代码使用。"
879903
880904#: ../../c-api/init.rst:594
881905msgid ""
@@ -889,6 +913,10 @@ msgid ""
889913"startup; it can be (and usually is) modified later to change the search path"
890914" for loading modules."
891915msgstr ""
916+ "返回默认模块搜索路径;这是根据程序名称(由上述 :c:func:`Py_SetProgramName` 设置)和某些环境变量计算得出的。 "
917+ "返回的字符串由一系列由依赖于平台的分隔符分开的目录名称组成。 分隔符在 Unix 和 macOS 上为 ``':'`` 而在 Windows 上为 "
918+ "``';'``。 返回的字符串将指向静态存储;调用方不应修改其值。 列表 :data:`sys.path` "
919+ "将在解释器启动时使用该值来初始化;它可以在随后被修改(并且通常都会被修改)以变更加载模块的搜索路径。"
892920
893921#: ../../c-api/init.rst:620
894922msgid ""
@@ -949,7 +977,7 @@ msgstr "现在 :data:`sys.executable` 将使用程序的完整路径,而不是
949977msgid ""
950978"Return the version of this Python interpreter. This is a string that looks "
951979"something like ::"
952- msgstr ""
980+ msgstr "返回 Python 解释器的版本。 这将为如下形式的字符串 :: "
953981
954982#: ../../c-api/init.rst:660
955983msgid ""
@@ -959,10 +987,12 @@ msgid ""
959987"not modify its value. The value is available to Python code as "
960988":data:`sys.version`."
961989msgstr ""
990+ "第一个单词(到第一个空格符为止)是当前的 Python 版本;前面的字符是以点号分隔的主要和次要版本号。 "
991+ "返回的字符串将指向静态存储;调用方不应修改其值。 该值将以 :data:`sys.version` 的名称供 Python 代码使用。"
962992
963993#: ../../c-api/init.rst:665
964994msgid "See also the :c:var:`Py_Version` constant."
965- msgstr ""
995+ msgstr "另请参阅 :c:var:`Py_Version` 常量。 "
966996
967997#: ../../c-api/init.rst:672
968998msgid ""
0 commit comments