@@ -229,6 +229,9 @@ msgid ""
229
229
"fieldnames. Regardless of how the fieldnames are determined, the dictionary "
230
230
"preserves their original ordering."
231
231
msgstr ""
232
+ "參數 *fieldnames* 是一個 :term:`sequence`。如果 *fieldnames* 被省略了,"
233
+ "檔案 *f* 中第一列的值會被當作欄位標題。不管欄位標題是如何決定的,dictionary"
234
+ "都會保留原始的排序。"
232
235
233
236
#: ../../library/csv.rst:161
234
237
msgid ""
@@ -238,26 +241,31 @@ msgid ""
238
241
"values are filled-in with the value of *restval* (which defaults to "
239
242
"``None``)."
240
243
msgstr ""
244
+ "如果一列資料中的欄位比欄位標題還多,其餘的資料及以 *restkey* (預設為 ``None``)"
245
+ "特指的欄位標題會放入列表當中並儲存。如果一個非空的 (non-blank) 列中的欄位比"
246
+ "欄位標題還少,缺少的值則會填入 *restval* (預設為 ``None``)的值。"
241
247
242
248
#: ../../library/csv.rst:167
243
249
msgid ""
244
250
"All other optional or keyword arguments are passed to the underlying :class:"
245
251
"`reader` instance."
246
252
msgstr ""
253
+ "所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。"
247
254
248
255
#: ../../library/csv.rst:170 ../../library/csv.rst:214
249
256
msgid ""
250
257
"If the argument passed to *fieldnames* is an iterator, it will be coerced to "
251
258
"a :class:`list`."
252
259
msgstr ""
260
+ "如果傳遞至 *fieldnames* 的引數是個疊代器,則會被迫成為一個 :class:`list`。"
253
261
254
262
#: ../../library/csv.rst:172
255
263
msgid "Returned rows are now of type :class:`OrderedDict`."
256
- msgstr ""
264
+ msgstr "回傳的列已成為型別 :class:`OrderedDict`。 "
257
265
258
266
#: ../../library/csv.rst:175
259
267
msgid "Returned rows are now of type :class:`dict`."
260
- msgstr ""
268
+ msgstr "回傳的列已成為型別 :class:`dict`。 "
261
269
262
270
#: ../../library/csv.rst:196
263
271
msgid ""
@@ -274,12 +282,23 @@ msgid ""
274
282
"other optional or keyword arguments are passed to the underlying :class:"
275
283
"`writer` instance."
276
284
msgstr ""
285
+ "建立一個物件,其運作上就像一般的寫入器,但可以將 dictionary map 到輸出的列上。"
286
+ "參數 *fieldnames* 是一個鍵值的 :mod:`sequence <collections.abc>` 且可以"
287
+ "辨識 dictionary 中傳遞至 :meth:`writerow` method 寫入至檔案 *f* 中的值。"
288
+ "如果 dictionary 中缺少了 *fieldnames* 的鍵值,則會寫入選填的參數 *restval* 的值"
289
+ "。如果傳遞至 :meth:`writerow` method 的 dictionary 包含了一個 *fieldnames* "
290
+ "中不存在的鍵值,選填的參數 *extrasaction* 可以指出該執行的動作。如果它被設定"
291
+ "為 ``'raise'``,預設會觸發 :exc:`ValueError`。如果它被設定為 ``'ignore'``,"
292
+ "dictionary 中額外的值會被忽略。其他選填的引數或關鍵字引數皆會傳遞"
293
+ "至下層的 :class:`writer` 實例。"
277
294
278
295
#: ../../library/csv.rst:211
279
296
msgid ""
280
297
"Note that unlike the :class:`DictReader` class, the *fieldnames* parameter "
281
298
"of the :class:`DictWriter` class is not optional."
282
299
msgstr ""
300
+ "請記得這不像類別 :class:`DictReader`,在類別 :class:`DictWriter` 中,參數 "
301
+ "*fieldnames* 並不是選填的。"
283
302
284
303
#: ../../library/csv.rst:232
285
304
msgid ""
@@ -289,48 +308,65 @@ msgid ""
289
308
"subtly different CSV data. :class:`Dialect` instances define how :class:"
290
309
"`reader` and :class:`writer` instances behave."
291
310
msgstr ""
311
+ "類別 :class:`Dialect` 是一個容器類別,其屬性 (attribute) 包含如何處理雙引號、"
312
+ "空白、分隔符號等資訊。由於缺少一個嚴謹的 CSV 技術規範,不同的應用程式會產出"
313
+ "有巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 "
314
+ ":class:`writer` 的實例該如何表示。"
292
315
293
316
#: ../../library/csv.rst:238
294
317
msgid ""
295
318
"All available :class:`Dialect` names are returned by :func:`list_dialects`, "
296
319
"and they can be registered with specific :class:`reader` and :class:`writer` "
297
320
"classes through their initializer (``__init__``) functions like this::"
298
321
msgstr ""
322
+ "所有可用的 :class:`Dialect` 名稱會透過 :func:`list_dialects` 回傳,且"
323
+ "它們可以透過特定 :class:`reader` 及 :class:`writer` 類別的"
324
+ "初始器 (initializer, ``__init__``) 函式進行註冊,就像這樣: ::"
299
325
300
326
#: ../../library/csv.rst:251
301
327
msgid ""
302
328
"The :class:`excel` class defines the usual properties of an Excel-generated "
303
329
"CSV file. It is registered with the dialect name ``'excel'``."
304
330
msgstr ""
331
+ "類別 :class:`excel` 定義了透過 Excel 產生的 CSV 檔案的慣用屬性。它被註冊的"
332
+ " dialect 名稱為 ``'excel'``。"
305
333
306
334
#: ../../library/csv.rst:257
307
335
msgid ""
308
336
"The :class:`excel_tab` class defines the usual properties of an Excel-"
309
337
"generated TAB-delimited file. It is registered with the dialect name "
310
338
"``'excel-tab'``."
311
339
msgstr ""
340
+ "類別 :class:`excel_tab` 定義了透過 Excel 產生並以 Tab 作為分隔的 CSV 檔案"
341
+ "的慣用屬性。它被註冊的 dialect 名稱為 ``'excel-tab'``。"
312
342
313
343
#: ../../library/csv.rst:263
314
344
msgid ""
315
345
"The :class:`unix_dialect` class defines the usual properties of a CSV file "
316
346
"generated on UNIX systems, i.e. using ``'\\ n'`` as line terminator and "
317
347
"quoting all fields. It is registered with the dialect name ``'unix'``."
318
348
msgstr ""
349
+ "類別 :class:`unix_dialect` 定義了透過 UNIX 系統產生的 CSV 檔案的慣用屬性,"
350
+ "換句話說,使用 ``'\\ n'`` 作為換行符號且所有欄位都被引號包覆起來。它被註冊的"
351
+ " dialect 名稱為 ``'unix'``。"
319
352
320
353
#: ../../library/csv.rst:272
321
354
msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file."
322
- msgstr ""
355
+ msgstr "類別 :class:`Sniffer` 被用來推斷 CSV 檔案的格式。 "
323
356
324
357
#: ../../library/csv.rst:274
325
358
msgid "The :class:`Sniffer` class provides two methods:"
326
- msgstr ""
359
+ msgstr "類別 :class:`Sniffer` 提供了兩個 method: "
327
360
328
361
#: ../../library/csv.rst:278
329
362
msgid ""
330
363
"Analyze the given *sample* and return a :class:`Dialect` subclass reflecting "
331
364
"the parameters found. If the optional *delimiters* parameter is given, it "
332
365
"is interpreted as a string containing possible valid delimiter characters."
333
366
msgstr ""
367
+ "分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參數。"
368
+ "如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、"
369
+ "有效的分隔字符。"
334
370
335
371
#: ../../library/csv.rst:286
336
372
msgid ""
0 commit comments