@@ -8,7 +8,7 @@ msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"POT-Creation-Date : 2023-07-17 17:39+0800\n "
11
- "PO-Revision-Date : 2023-09-10 10:26 +0800\n "
11
+ "PO-Revision-Date : 2023-11-08 15:06 +0800\n "
12
12
"Last-Translator : RockLeon <therockleona@gmail.com>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
@@ -17,7 +17,7 @@ msgstr ""
17
17
"Content-Type : text/plain; charset=UTF-8\n "
18
18
"Content-Transfer-Encoding : 8bit\n "
19
19
"Plural-Forms : nplurals=1; plural=0;\n "
20
- "X-Generator : Poedit 3.3.2 \n "
20
+ "X-Generator : Poedit 3.4 \n "
21
21
22
22
#: ../../library/csv.rst:2
23
23
msgid ":mod:`csv` --- CSV File Reading and Writing"
@@ -360,7 +360,7 @@ msgid ""
360
360
msgstr ""
361
361
"分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參"
362
362
"數。如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、有效的分"
363
- "隔字符 。"
363
+ "隔字元 。"
364
364
365
365
#: ../../library/csv.rst:286
366
366
msgid ""
@@ -507,15 +507,21 @@ msgid ""
507
507
"specify individual formatting parameters, which have the same names as the "
508
508
"attributes defined below for the :class:`Dialect` class."
509
509
msgstr ""
510
+ "為了讓指定輸入及輸出紀錄的格式更方便,特定的格式化參數會被組成 dialect。一個 "
511
+ "dialect 是 :class:`Dialect` class 的子類別,其有一組特定的方法及單獨的 :meth:"
512
+ "`validate` 方法。當建立 :class:`reader` 或 :class:`writer` 物件時,程式設計師"
513
+ "可以指定一個字串或是一個 :class:`Dialect` 的子類別作為 dialect 參數。此外,或"
514
+ "是作為替代,在\\ *dialect*\\ 參數中,程式設計師可以指定個別的格式化參數,其"
515
+ "與 :class:`Dialect` 類別定義的屬性具有相同的名字。"
510
516
511
517
#: ../../library/csv.rst:382
512
518
msgid "Dialects support the following attributes:"
513
- msgstr ""
519
+ msgstr "Dialect 支援下列屬性: "
514
520
515
521
#: ../../library/csv.rst:387
516
522
msgid ""
517
523
"A one-character string used to separate fields. It defaults to ``','``."
518
- msgstr ""
524
+ msgstr "一個單一字元 (one-character) 的字串可已用來分割欄位。預設為 ``','``。 "
519
525
520
526
#: ../../library/csv.rst:392
521
527
msgid ""
@@ -524,12 +530,17 @@ msgid ""
524
530
"const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It "
525
531
"defaults to :const:`True`."
526
532
msgstr ""
533
+ "控制 *quotechar* 的實例何時出現在欄位之中,並讓它們自己被放在引號之內。當屬性"
534
+ "為 :const:`True`,字元會是雙引號。若為 :const:`False`,在 *quotechar* 之前會"
535
+ "先使用 *escapechar* 作為前綴字。預設為 :const:`True`。"
527
536
528
537
#: ../../library/csv.rst:397
529
538
msgid ""
530
539
"On output, if *doublequote* is :const:`False` and no *escapechar* is set, :"
531
540
"exc:`Error` is raised if a *quotechar* is found in a field."
532
541
msgstr ""
542
+ "在輸出時,若 *doublequote* 是 :const:`False` 且\\ *逸出字元*\\ 沒有被設定,當"
543
+ "一個\\ *引號*\\ 在欄位中被發現時,:exc:`Error` 會被引發。"
533
544
534
545
#: ../../library/csv.rst:403
535
546
msgid ""
@@ -539,63 +550,79 @@ msgid ""
539
550
"from the following character. It defaults to :const:`None`, which disables "
540
551
"escaping."
541
552
msgstr ""
553
+ "一個會被寫入器使用的單一字元的字串,當 *quoting* 設定為 :const:`QUOTE_NONE` "
554
+ "時逸出\\ *分隔符號*\\ ;當 *doublequote* 設定為 :const:`False` 時逸出\\ *引號"
555
+ "*\\ 。在讀取時,\\ *逸出字元*\\ 會移除後面的字元以及任何特殊意義。預設為 :"
556
+ "const:`None`,表示禁止逸出。"
542
557
543
558
#: ../../library/csv.rst:408
544
559
msgid "An empty *escapechar* is not allowed."
545
- msgstr ""
560
+ msgstr "*escapechar* 為空是不被接受的。 "
546
561
547
562
#: ../../library/csv.rst:413
548
563
msgid ""
549
564
"The string used to terminate lines produced by the :class:`writer`. It "
550
565
"defaults to ``'\\ r\\ n'``."
551
- msgstr ""
566
+ msgstr "由 :class:`writer` 產生被用來分行的字串。預設為 ``' \\ r \\ n'``。 "
552
567
553
568
#: ../../library/csv.rst:418
554
569
msgid ""
555
570
"The :class:`reader` is hard-coded to recognise either ``'\\ r'`` or ``'\\ n'`` "
556
571
"as end-of-line, and ignores *lineterminator*. This behavior may change in "
557
572
"the future."
558
573
msgstr ""
574
+ ":class:`reader`是 hard-coded 辨別 ``'\\ r'`` or ``'\\ n'`` 作為行尾 (end-of-"
575
+ "line),並忽略\\ *分行符號*\\ 。未來可能會改變這個行為。"
559
576
560
577
#: ../../library/csv.rst:425
561
578
msgid ""
562
579
"A one-character string used to quote fields containing special characters, "
563
580
"such as the *delimiter* or *quotechar*, or which contain new-line "
564
581
"characters. It defaults to ``'\" '``."
565
582
msgstr ""
583
+ "一個單一字元的字串被用於引用包含特殊字元的欄位,像是 *delimiter*、"
584
+ "*quotechar* 或是換行字元。預設為 ``'\" '``。"
566
585
567
586
#: ../../library/csv.rst:429
568
587
msgid "An empty *quotechar* is not allowed."
569
- msgstr ""
588
+ msgstr "*quotechar* 為空是不被允許的。 "
570
589
571
590
#: ../../library/csv.rst:434
572
591
msgid ""
573
592
"Controls when quotes should be generated by the writer and recognised by the "
574
593
"reader. It can take on any of the :const:`QUOTE_\\ *` constants (see "
575
594
"section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`."
576
595
msgstr ""
596
+ "控制 writer 何時產生引號,以及 reader 如何辨識引號。他可以使用任何 :const:"
597
+ "`QUOTE_\\ *` 常數(請見段落 :ref:`csv-contents`)且預設為 :const:"
598
+ "`QUOTE_MINIMAL`。"
577
599
578
600
#: ../../library/csv.rst:441
579
601
msgid ""
580
602
"When :const:`True`, spaces immediately following the *delimiter* are "
581
603
"ignored. The default is :const:`False`."
582
604
msgstr ""
605
+ "若為 :const:`True`,在緊接著\\ *分隔符號*\\ 後的空格會被忽略。預設為 :const:"
606
+ "`False`。"
583
607
584
608
#: ../../library/csv.rst:447
585
609
msgid ""
586
610
"When ``True``, raise exception :exc:`Error` on bad CSV input. The default is "
587
611
"``False``."
588
612
msgstr ""
613
+ "若為 ``True``,若有錯誤的 CSV 輸入則會引發 :exc:`Error`。預設為 ``False``。"
589
614
590
615
#: ../../library/csv.rst:451
591
616
msgid "Reader Objects"
592
- msgstr ""
617
+ msgstr "讀取器物件 "
593
618
594
619
#: ../../library/csv.rst:453
595
620
msgid ""
596
621
"Reader objects (:class:`DictReader` instances and objects returned by the :"
597
622
"func:`reader` function) have the following public methods:"
598
623
msgstr ""
624
+ "讀取器物件(:func:`reader` 函式回傳的 :class:`DictReader` 實例與物件)有下列"
625
+ "公用方法 (public method):"
599
626
600
627
#: ../../library/csv.rst:458
601
628
msgid ""
@@ -604,34 +631,39 @@ msgid ""
604
631
"instance), parsed according to the current :class:`Dialect`. Usually you "
605
632
"should call this as ``next(reader)``."
606
633
msgstr ""
634
+ "回傳一個列表為讀入器的可疊代物件的下一列內容(若該物件是由 :func:`reader` 回"
635
+ "傳)或是一個 dict(若為 :class:`DictReader` 實例),會依據當前的 :class:"
636
+ "`Dialect` 進行剖析。通常會用 ``next(reader)`` 來進行呼叫。"
607
637
608
638
#: ../../library/csv.rst:464
609
639
msgid "Reader objects have the following public attributes:"
610
- msgstr ""
640
+ msgstr "讀取器物件有下列公用屬性 (public attributes): "
611
641
612
642
#: ../../library/csv.rst:468
613
643
msgid "A read-only description of the dialect in use by the parser."
614
- msgstr ""
644
+ msgstr "dialect 的唯讀敘述,會被剖析器使用。 "
615
645
616
646
#: ../../library/csv.rst:473
617
647
msgid ""
618
648
"The number of lines read from the source iterator. This is not the same as "
619
649
"the number of records returned, as records can span multiple lines."
620
- msgstr ""
650
+ msgstr "來源疊代器所讀取的行數。這與回傳的紀錄數不同,因為可以進行跨行紀錄。 "
621
651
622
652
#: ../../library/csv.rst:477
623
653
msgid "DictReader objects have the following public attribute:"
624
- msgstr ""
654
+ msgstr "DictReader 物件有下列公用屬性: "
625
655
626
656
#: ../../library/csv.rst:481
627
657
msgid ""
628
658
"If not passed as a parameter when creating the object, this attribute is "
629
659
"initialized upon first access or when the first record is read from the file."
630
660
msgstr ""
661
+ "若在建立物件時沒有作為參數傳遞,這個屬性會在第一次存取之前或是第一筆資料被讀"
662
+ "取之前進行初始化 (initialize)。"
631
663
632
664
#: ../../library/csv.rst:488
633
665
msgid "Writer Objects"
634
- msgstr ""
666
+ msgstr "寫入器物件 "
635
667
636
668
#: ../../library/csv.rst:490
637
669
msgid ""
@@ -644,65 +676,80 @@ msgid ""
644
676
"problems for other programs which read CSV files (assuming they support "
645
677
"complex numbers at all)."
646
678
msgstr ""
679
+ ":class:`Writer` 物件(:func:`writer` 函式回傳的 :class:`DictWriter` 實例與物"
680
+ "件)有下列公用方法。對於 :class:`Writer` 物件而言,一個\\ *列*\\ 中必須為一個"
681
+ "可疊代的字串或是數字;對於 :class:`DictWriter` 物件而言,則必須為一個 "
682
+ "dictionary ,且可以對應欄位標題至字串或數字(會先透過 :func:`str` 進行傳"
683
+ "遞)。請注意,在寫入複數 (complex number) 時會用小括號 (parens) 包起來。這可"
684
+ "能在其他程式讀取 CSV 檔案時導致某些問題(假設他們完全支援複雜數字)。"
647
685
648
686
#: ../../library/csv.rst:501
649
687
msgid ""
650
688
"Write the *row* parameter to the writer's file object, formatted according "
651
689
"to the current :class:`Dialect`. Return the return value of the call to the "
652
690
"*write* method of the underlying file object."
653
691
msgstr ""
692
+ "將參數 *row* 寫入至寫入器的檔案物件中,並依照當前的 :class:`Dialect` 進行格式"
693
+ "化。回傳下層檔案物件 *write* 方法的回傳值。"
654
694
655
695
#: ../../library/csv.rst:505
656
696
msgid "Added support of arbitrary iterables."
657
- msgstr "新增對任意 iterable 的支援。"
697
+ msgstr "新增對任意可疊代物件 (arbitrary iterables) 的支援。"
658
698
659
699
#: ../../library/csv.rst:510
660
700
msgid ""
661
701
"Write all elements in *rows* (an iterable of *row* objects as described "
662
702
"above) to the writer's file object, formatted according to the current "
663
703
"dialect."
664
704
msgstr ""
705
+ "將 *rows* 中所有元素(為上述的一個可疊代的 *row* 物件)寫入至寫入器的檔案物件"
706
+ "中,並依照當前的 dialect 進行格式化。"
665
707
666
708
#: ../../library/csv.rst:514
667
709
msgid "Writer objects have the following public attribute:"
668
- msgstr ""
710
+ msgstr "寫入器物件有下列公用屬性: "
669
711
670
712
#: ../../library/csv.rst:519
671
713
msgid "A read-only description of the dialect in use by the writer."
672
- msgstr ""
714
+ msgstr "dialect 的唯讀敘述,會被寫入器使用。 "
673
715
674
716
#: ../../library/csv.rst:522
675
717
msgid "DictWriter objects have the following public method:"
676
- msgstr ""
718
+ msgstr "DictWriter 物件有下列公用方法: "
677
719
678
720
#: ../../library/csv.rst:527
679
721
msgid ""
680
722
"Write a row with the field names (as specified in the constructor) to the "
681
723
"writer's file object, formatted according to the current dialect. Return the "
682
724
"return value of the :meth:`csvwriter.writerow` call used internally."
683
725
msgstr ""
726
+ "將具欄位標題的一列(於建構函式 (constructor) 中指定的)寫入至寫入器的檔案物件"
727
+ "中,並依照當前的 dialect 進行格式化。回傳內部呼叫 :meth:`csvwriter.writerow` "
728
+ "的回傳值。"
684
729
685
730
#: ../../library/csv.rst:532
686
731
msgid ""
687
732
":meth:`writeheader` now also returns the value returned by the :meth:"
688
733
"`csvwriter.writerow` method it uses internally."
689
734
msgstr ""
735
+ ":meth:`writeheader` 現在也會回傳內部呼叫 :meth:`csvwriter.writerow` 的回傳"
736
+ "值。"
690
737
691
738
#: ../../library/csv.rst:540
692
739
msgid "Examples"
693
740
msgstr "範例"
694
741
695
742
#: ../../library/csv.rst:542
696
743
msgid "The simplest example of reading a CSV file::"
697
- msgstr ""
744
+ msgstr "最簡單的讀取 CSV 檔案範例: :: "
698
745
699
746
#: ../../library/csv.rst:550
700
747
msgid "Reading a file with an alternate format::"
701
- msgstr ""
748
+ msgstr "讀取一個其他格式的檔案: :: "
702
749
703
750
#: ../../library/csv.rst:558
704
751
msgid "The corresponding simplest possible writing example is::"
705
- msgstr ""
752
+ msgstr "相對最簡單、可行的寫入範例為: :: "
706
753
707
754
#: ../../library/csv.rst:565
708
755
msgid ""
@@ -711,28 +758,33 @@ msgid ""
711
758
"`locale.getencoding`). To decode a file using a different encoding, use the "
712
759
"``encoding`` argument of open::"
713
760
msgstr ""
761
+ "當 :func:`open` 被使用於開啟並讀取一個 CSV 檔案,該檔案會預設使用系統預設的編"
762
+ "碼格式(請見 :func:`locale.getencoding`),並解碼為 unicode。若要使用不同編碼"
763
+ "格式進行檔案解碼,請使用 open 函式的 ``encoding`` 引數: ::"
714
764
715
765
#: ../../library/csv.rst:576
716
766
msgid ""
717
767
"The same applies to writing in something other than the system default "
718
768
"encoding: specify the encoding argument when opening the output file."
719
769
msgstr ""
770
+ "同理可以應用到使用不同編碼格式進行寫入:當開啟輸出檔案時,指定 ``encoding`` "
771
+ "引數。"
720
772
721
773
#: ../../library/csv.rst:579
722
774
msgid "Registering a new dialect::"
723
- msgstr ""
775
+ msgstr "註冊一個新的 dialect : :: "
724
776
725
777
#: ../../library/csv.rst:586
726
778
msgid ""
727
779
"A slightly more advanced use of the reader --- catching and reporting "
728
780
"errors::"
729
- msgstr ""
781
+ msgstr "稍微進階的讀取器用法 -- 擷取及回報錯誤: :: "
730
782
731
783
#: ../../library/csv.rst:598
732
784
msgid ""
733
785
"And while the module doesn't directly support parsing strings, it can easily "
734
786
"be done::"
735
- msgstr ""
787
+ msgstr "而當模組無法直接支援剖析字串時,仍可以輕鬆的解決: :: "
736
788
737
789
#: ../../library/csv.rst:607
738
790
msgid "Footnotes"
@@ -746,6 +798,10 @@ msgid ""
746
798
"safe to specify ``newline=''``, since the csv module does its own (:term:"
747
799
"`universal <universal newlines>`) newline handling."
748
800
msgstr ""
801
+ "如果 ``newline=''`` 沒有被指定,則嵌入引號中的換行符號不會被正確直譯,使用 "
802
+ "``\\ r\\ n`` 行尾 (linending) 的平台會寫入額外的 ``\\ r``。自從 csv 模組有自己 "
803
+ "(:term:`統一的 <universal newlines>`) 換行處理方式,因此指定 ``newline=''`` "
804
+ "會永遠是安全的。"
749
805
750
806
#: ../../library/csv.rst:11
751
807
msgid "csv"
0 commit comments