1111# ppcfish <[email protected] >, 20191212# ruoyu zhang <[email protected] >, 20191313# kks uch <[email protected] >, 202014- # Freesand Leo <[email protected] >, 20201514# zeroswan <[email protected] >, 202015+ # Freesand Leo <[email protected] >, 20201616#
1717#, fuzzy
1818msgid ""
@@ -21,7 +21,7 @@ msgstr ""
2121"Report-Msgid-Bugs-To : \n "
2222"POT-Creation-Date : 2020-05-31 09:25+0000\n "
2323"PO-Revision-Date : 2017-02-16 23:05+0000\n "
24- "Last-Translator : zeroswan <weditor @163.com>, 2020\n "
24+ "Last-Translator : Freesand Leo <yuqinju @163.com>, 2020\n "
2525"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2626"MIME-Version : 1.0\n "
2727"Content-Type : text/plain; charset=UTF-8\n "
@@ -1289,7 +1289,7 @@ msgid ""
12891289"This is nice and fine, but how would one access the additional elements "
12901290"contained in this array? Since the type still only knows about 4 elements, "
12911291"we get errors accessing other elements::"
1292- msgstr "这非常好,但是要怎么访问数组中额外的元素呢?因为数组类型已经定义包含4个元素,women访问新增元素会产生以下错误 ::"
1292+ msgstr "这非常好,但是要怎么访问数组中额外的元素呢?因为数组类型已经定义包含4个元素,导致我们访问新增元素时会产生以下错误 ::"
12931293
12941294#: ../../library/ctypes.rst:1232
12951295msgid ""
@@ -1399,14 +1399,14 @@ msgstr "加载动态链接库"
13991399msgid ""
14001400"There are several ways to load shared libraries into the Python process. "
14011401"One way is to instantiate one of the following classes:"
1402- msgstr ""
1402+ msgstr "有很多方式可以将动态链接库加载到 Python 进程。其中之一是实例化以下类的其中一个:: "
14031403
14041404#: ../../library/ctypes.rst:1325
14051405msgid ""
14061406"Instances of this class represent loaded shared libraries. Functions in "
14071407"these libraries use the standard C calling convention, and are assumed to "
14081408"return :c:type:`int`."
1409- msgstr ""
1409+ msgstr "此类的实例即已加载的动态链接库。库中的函数使用标准 C 调用约定,并假定返回 :c:type:`int` 。 "
14101410
14111411#: ../../library/ctypes.rst:1332
14121412msgid ""
@@ -1417,30 +1417,36 @@ msgid ""
14171417"call failed or succeeded, together with additional error code. If the "
14181418"return value signals a failure, an :class:`OSError` is automatically raised."
14191419msgstr ""
1420+ "仅 Windows : 此类的实例即加载好的动态链接库,其中的函数使用 ``stdcall`` 调用约定,并且假定返回 windows 指定的 "
1421+ ":class:`HRESULT` 返回码。 :class:`HRESULT` 的值包含的信息说明函数调用成功还是失败,以及额外错误码。 "
1422+ "如果返回值表示失败,会自动抛出 :class:`OSError` 异常。 "
14201423
14211424#: ../../library/ctypes.rst:1339
14221425msgid ":exc:`WindowsError` used to be raised."
1423- msgstr ""
1426+ msgstr "以前是引发 :exc:`WindowsError`。 "
14241427
14251428#: ../../library/ctypes.rst:1345
14261429msgid ""
14271430"Windows only: Instances of this class represent loaded shared libraries, "
14281431"functions in these libraries use the ``stdcall`` calling convention, and are"
14291432" assumed to return :c:type:`int` by default."
14301433msgstr ""
1434+ "仅 Windows: 此类的实例即加载好的动态链接库,其中的函数使用 ``stdcall`` 调用约定,并假定默认返回 :c:type:`int` 。"
14311435
14321436#: ../../library/ctypes.rst:1349
14331437msgid ""
14341438"On Windows CE only the standard calling convention is used, for convenience "
14351439"the :class:`WinDLL` and :class:`OleDLL` use the standard calling convention "
14361440"on this platform."
14371441msgstr ""
1442+ "在 Windows CE 上,只能使用 stdcall 调用约定,为了方便, :class:`WinDLL` 和 :class:`OleDLL` "
1443+ "在这个平台上都使用标准调用约定。"
14381444
14391445#: ../../library/ctypes.rst:1353
14401446msgid ""
14411447"The Python :term:`global interpreter lock` is released before calling any "
14421448"function exported by these libraries, and reacquired afterwards."
1443- msgstr ""
1449+ msgstr "调用动态库导出的函数之前,Python会释放 :term:`global interpreter lock` ,并在调用后重新获取。 "
14441450
14451451#: ../../library/ctypes.rst:1359
14461452msgid ""
@@ -1449,10 +1455,12 @@ msgid ""
14491455"function execution the Python error flag is checked. If the error flag is "
14501456"set, a Python exception is raised."
14511457msgstr ""
1458+ "这个类实例的行为与 :class:`CDLL` 类似,只不过 *不会* 在调用函数的时候释放 GIL 锁,且调用结束后会检查 Python 错误码。 "
1459+ "如果错误码被设置,会抛出一个 Python 异常。"
14521460
14531461#: ../../library/ctypes.rst:1364
14541462msgid "Thus, this is only useful to call Python C api functions directly."
1455- msgstr ""
1463+ msgstr "所以,它只在直接调用 Python C 接口函数的时候有用。 "
14561464
14571465#: ../../library/ctypes.rst:1366
14581466msgid ""
@@ -1463,6 +1471,8 @@ msgid ""
14631471" ``LoadLibrary`` function is used to load the library into the process, and "
14641472"to get a handle to it."
14651473msgstr ""
1474+ "通过使用至少一个参数(共享库的路径名)调用它们,可以实例化所有这些类。也可以传入一个已加载的动态链接库作为 ``handler`` "
1475+ "参数,其他情况会调用系统底层的 ``dlopen`` 或 ``LoadLibrary`` 函数将库加载到进程,并获取其句柄。"
14661476
14671477#: ../../library/ctypes.rst:1373
14681478msgid ""
@@ -1471,6 +1481,8 @@ msgid ""
14711481"ignored. On posix systems, RTLD_NOW is always added, and is not "
14721482"configurable."
14731483msgstr ""
1484+ "*mode* 可以指定库加载方式。详情请参见 :manpage:`dlopen(3)` 手册页。 在 Windows 上, 会忽略 *mode* ,在"
1485+ " posix 系统上, 总是会加上 RTLD_NOW ,且无法配置。"
14741486
14751487#: ../../library/ctypes.rst:1378
14761488msgid ""
0 commit comments