-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathfile.po
More file actions
111 lines (102 loc) · 5.95 KB
/
file.po
File metadata and controls
111 lines (102 loc) · 5.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2021, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alpha Du <alphanow@gmail.com>, 2019
# Freesand Leo <yuqinju@163.com>, 2019
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
"PO-Revision-Date: 2019-09-01 03:40+0000\n"
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2019\n"
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../c-api/file.rst:6
msgid "File Objects"
msgstr "文件对象"
#: ../../c-api/file.rst:10
msgid ""
"These APIs are a minimal emulation of the Python 2 C API for built-in file "
"objects, which used to rely on the buffered I/O (:c:type:`FILE\\*`) support "
"from the C standard library. In Python 3, files and streams use the new "
":mod:`io` module, which defines several layers over the low-level unbuffered"
" I/O of the operating system. The functions described below are convenience"
" C wrappers over these new APIs, and meant mostly for internal error "
"reporting in the interpreter; third-party code is advised to access the "
":mod:`io` APIs instead."
msgstr ""
"这些 API 是内置文件对象的 Python 2 C API 的最小仿真,它过去依赖于C标准库的缓冲 I/O( :c:type:`FILE\\*` "
")支持。 在Python 3中,文件和流使用新的 :mod:`io` 模块,该模块在操作系统的低级无缓冲 I/O 上定义了几个层。 "
"下面描述的函数是针对这些新API的便捷 C 包装器,主要用于解释器中的内部错误报告;建议第三方代码访问 :mod:`io` API。"
#: ../../c-api/file.rst:22
msgid ""
"Create a Python file object from the file descriptor of an already opened "
"file *fd*. The arguments *name*, *encoding*, *errors* and *newline* can be "
"``NULL`` to use the defaults; *buffering* can be *-1* to use the default. "
"*name* is ignored and kept for backward compatibility. Return ``NULL`` on "
"failure. For a more comprehensive description of the arguments, please refer"
" to the :func:`io.open` function documentation."
msgstr ""
"根据已打开文件 *fd* 的文件描述符创建一个 Python 文件对象。 参数 *name*, *encoding*, *errors* 和 "
"*newline* 可以为 ``NULL`` 表示使用默认值;*buffering* 可以为 *-1* 表示使用默认值。 *name* "
"会被忽略仅保留用于向下兼容。 失败时返回 ``NULL``。 有关参数的更全面描述,请参阅 :func:`io.open` 函数的文档。"
#: ../../c-api/file.rst:31
msgid ""
"Since Python streams have their own buffering layer, mixing them with OS-"
"level file descriptors can produce various issues (such as unexpected "
"ordering of data)."
msgstr "由于Python流具有自己的缓冲层,因此将它们与 OS 级文件描述符混合会产生各种问题(例如数据的意外排序)。"
#: ../../c-api/file.rst:35
msgid "Ignore *name* attribute."
msgstr "忽略 *name* 属性。"
#: ../../c-api/file.rst:41
msgid ""
"Return the file descriptor associated with *p* as an :c:type:`int`. If the "
"object is an integer, its value is returned. If not, the object's "
":meth:`~io.IOBase.fileno` method is called if it exists; the method must "
"return an integer, which is returned as the file descriptor value. Sets an "
"exception and returns ``-1`` on failure."
msgstr ""
"将与 *p* 关联的文件描述器返回为 :c:type:`int` 。 如果对象是整数,则返回其值。 如果没有,则调用对象的 "
":meth:`~io.IOBase.fileno` 方法(如果存在); 该方法必须返回一个整数,该整数作为文件描述器值返回。 设置异常并在失败时返回 "
"``-1``。"
#: ../../c-api/file.rst:52
msgid ""
"Equivalent to ``p.readline([n])``, this function reads one line from the "
"object *p*. *p* may be a file object or any object with a "
":meth:`~io.IOBase.readline` method. If *n* is ``0``, exactly one line is "
"read, regardless of the length of the line. If *n* is greater than ``0``, "
"no more than *n* bytes will be read from the file; a partial line can be "
"returned. In both cases, an empty string is returned if the end of the file"
" is reached immediately. If *n* is less than ``0``, however, one line is "
"read regardless of length, but :exc:`EOFError` is raised if the end of the "
"file is reached immediately."
msgstr ""
"等价于 ``p.readline([n])`` ,这个函数从对象 *p* 中读取一行。 *p* 可以是文件对象或具有 "
":meth:`~io.IOBase.readline` 方法的任何对象。 如果 *n* 是 ``0`` ,则无论该行的长度如何,都会读取一行。 如果 "
"*n* 大于``0``,则从文件中读取不超过 *n* 个字节;可以返回行的一部分。 在这两种情况下,如果立即到达文件末尾,则返回空字符串。 但是,如果 "
"*n* 小于 ``0`` ,则无论长度如何都会读取一行,但是如果立即到达文件末尾,则引发 :exc:`EOFError`。"
#: ../../c-api/file.rst:67
msgid ""
"Write object *obj* to file object *p*. The only supported flag for *flags* "
"is :const:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written"
" instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure;"
" the appropriate exception will be set."
msgstr ""
"将对象 *obj* 写入文件对象 *p* 。 *flags* 唯一支持的标志是 :const:`Py_PRINT_RAW`;如果给定,则写入对象的 "
":func:`str` 而不是 :func:`repr`。成功时返回 ``0``,失败时返回 ``-1``。 将设置适当的例外。"
#: ../../c-api/file.rst:75
msgid ""
"Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on "
"failure; the appropriate exception will be set."
msgstr "将字符串 *s* 写入文件对象 *p*。 成功返回 ``0`` 失败返回 ``-1``;将设定相应的异常。"