99msgstr ""
1010"Project-Id-Version :Python 3.10\n "
1111"Report-Msgid-Bugs-To :\n "
12- "POT-Creation-Date :2022-05-21 17:35 +0000\n "
12+ "POT-Creation-Date :2022-06-10 00:16 +0000\n "
1313"PO-Revision-Date :2018-05-23 14:35+0000\n "
1414"Last-Translator :Adrian Liaw <adrianliaw2000@gmail.com>\n "
1515"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -519,53 +519,58 @@ msgstr ""
519519
520520#: ../../faq/library.rst:486
521521msgid ""
522- "The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note "
523- "that on MacOS 9 it doesn't copy the resource fork and Finder info."
522+ "The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note "
523+ "that on Windows NTFS volumes, it does not copy `alternate data streams "
524+ "<https://en.wikipedia.org/wiki/NTFS#Alternate_data_stream_(ADS)>`_ nor "
525+ "`resource forks <https://en.wikipedia.org/wiki/Resource_fork>`__ on macOS HFS"
526+ "+ volumes, though both are now rarely used. It also doesn't copy file "
527+ "permissions and metadata, though using :func:`shutil.copy2` instead will "
528+ "preserve most (though not all) of it."
524529msgstr ""
525530
526- #: ../../faq/library.rst:491
531+ #: ../../faq/library.rst:497
527532msgid "How do I read (or write) binary data?"
528533msgstr ""
529534
530- #: ../../faq/library.rst:493
535+ #: ../../faq/library.rst:499
531536msgid ""
532537"To read or write complex binary data formats, it's best to use the :mod:"
533538"`struct` module. It allows you to take a string containing binary data "
534539"(usually numbers) and convert it to Python objects; and vice versa."
535540msgstr ""
536541
537- #: ../../faq/library.rst:497
542+ #: ../../faq/library.rst:503
538543msgid ""
539544"For example, the following code reads two 2-byte integers and one 4-byte "
540545"integer in big-endian format from a file::"
541546msgstr ""
542547
543- #: ../../faq/library.rst:506
548+ #: ../../faq/library.rst:512
544549msgid ""
545550"The '>' in the format string forces big-endian data; the letter 'h' reads "
546551"one\" short integer\" (2 bytes), and 'l' reads one\" long integer\" (4 "
547552"bytes) from the string."
548553msgstr ""
549554
550- #: ../../faq/library.rst:510
555+ #: ../../faq/library.rst:516
551556msgid ""
552557"For data that is more regular (e.g. a homogeneous list of ints or floats), "
553558"you can also use the :mod:`array` module."
554559msgstr ""
555560
556- #: ../../faq/library.rst:515
561+ #: ../../faq/library.rst:521
557562msgid ""
558563"To read and write binary data, it is mandatory to open the file in binary "
559564"mode (here, passing ``\" rb\" `` to :func:`open`). If you use ``\" r\" `` "
560565"instead (the default), the file will be open in text mode and ``f.read()`` "
561566"will return :class:`str` objects rather than :class:`bytes` objects."
562567msgstr ""
563568
564- #: ../../faq/library.rst:523
569+ #: ../../faq/library.rst:529
565570msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?"
566571msgstr ""
567572
568- #: ../../faq/library.rst:525
573+ #: ../../faq/library.rst:531
569574msgid ""
570575":func:`os.read` is a low-level function which takes a file descriptor, a "
571576"small integer representing the opened file. :func:`os.popen` creates a high-"
@@ -574,37 +579,37 @@ msgid ""
574579"popen`, you need to use ``p.read(n)``."
575580msgstr ""
576581
577- #: ../../faq/library.rst:612
582+ #: ../../faq/library.rst:618
578583msgid "How do I access the serial (RS232) port?"
579584msgstr ""
580585
581- #: ../../faq/library.rst:614
586+ #: ../../faq/library.rst:620
582587msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:"
583588msgstr ""
584589
585- #: ../../faq/library.rst:616
590+ #: ../../faq/library.rst:622
586591msgid "https://pypi.org/project/pyserial/"
587592msgstr "https://pypi.org/project/pyserial/"
588593
589- #: ../../faq/library.rst:618
594+ #: ../../faq/library.rst:624
590595msgid "For Unix, see a Usenet post by Mitch Chapman:"
591596msgstr ""
592597
593- #: ../../faq/library.rst:620
598+ #: ../../faq/library.rst:626
594599msgid "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com"
595600msgstr "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com"
596601
597- #: ../../faq/library.rst:624
602+ #: ../../faq/library.rst:630
598603msgid "Why doesn't closing sys.stdout (stdin, stderr) really close it?"
599604msgstr ""
600605
601- #: ../../faq/library.rst:626
606+ #: ../../faq/library.rst:632
602607msgid ""
603608"Python :term:`file objects <file object>` are a high-level layer of "
604609"abstraction on low-level C file descriptors."
605610msgstr ""
606611
607- #: ../../faq/library.rst:629
612+ #: ../../faq/library.rst:635
608613msgid ""
609614"For most file objects you create in Python via the built-in :func:`open` "
610615"function, ``f.close()`` marks the Python file object as being closed from "
@@ -613,120 +618,120 @@ msgid ""
613618"``f`` becomes garbage."
614619msgstr ""
615620
616- #: ../../faq/library.rst:635
621+ #: ../../faq/library.rst:641
617622msgid ""
618623"But stdin, stdout and stderr are treated specially by Python, because of the "
619624"special status also given to them by C. Running ``sys.stdout.close()`` "
620625"marks the Python-level file object as being closed, but does *not* close the "
621626"associated C file descriptor."
622627msgstr ""
623628
624- #: ../../faq/library.rst:640
629+ #: ../../faq/library.rst:646
625630msgid ""
626631"To close the underlying C file descriptor for one of these three, you should "
627632"first be sure that's what you really want to do (e.g., you may confuse "
628633"extension modules trying to do I/O). If it is, use :func:`os.close`::"
629634msgstr ""
630635
631- #: ../../faq/library.rst:648
636+ #: ../../faq/library.rst:654
632637msgid "Or you can use the numeric constants 0, 1 and 2, respectively."
633638msgstr ""
634639
635- #: ../../faq/library.rst:652
640+ #: ../../faq/library.rst:658
636641msgid "Network/Internet Programming"
637642msgstr ""
638643
639- #: ../../faq/library.rst:655
644+ #: ../../faq/library.rst:661
640645msgid "What WWW tools are there for Python?"
641646msgstr ""
642647
643- #: ../../faq/library.rst:657
648+ #: ../../faq/library.rst:663
644649msgid ""
645650"See the chapters titled :ref:`internet` and :ref:`netdata` in the Library "
646651"Reference Manual. Python has many modules that will help you build server-"
647652"side and client-side web systems."
648653msgstr ""
649654
650- #: ../../faq/library.rst:663
655+ #: ../../faq/library.rst:669
651656msgid ""
652657"A summary of available frameworks is maintained by Paul Boddie at https://"
653658"wiki.python.org/moin/WebProgramming\\ ."
654659msgstr ""
655660
656- #: ../../faq/library.rst:666
661+ #: ../../faq/library.rst:672
657662msgid ""
658663"Cameron Laird maintains a useful set of pages about Python web technologies "
659664"at http://phaseit.net/claird/comp.lang.python/web_python."
660665msgstr ""
661666
662- #: ../../faq/library.rst:671
667+ #: ../../faq/library.rst:677
663668msgid "How can I mimic CGI form submission (METHOD=POST)?"
664669msgstr ""
665670
666- #: ../../faq/library.rst:673
671+ #: ../../faq/library.rst:679
667672msgid ""
668673"I would like to retrieve web pages that are the result of POSTing a form. Is "
669674"there existing code that would let me do this easily?"
670675msgstr ""
671676
672- #: ../../faq/library.rst:676
677+ #: ../../faq/library.rst:682
673678msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::"
674679msgstr ""
675680
676- #: ../../faq/library.rst:691
681+ #: ../../faq/library.rst:697
677682msgid ""
678683"Note that in general for percent-encoded POST operations, query strings must "
679684"be quoted using :func:`urllib.parse.urlencode`. For example, to send "
680685"``name=Guy Steele, Jr.``::"
681686msgstr ""
682687
683- #: ../../faq/library.rst:699
688+ #: ../../faq/library.rst:705
684689msgid ":ref:`urllib-howto` for extensive examples."
685690msgstr ""
686691
687- #: ../../faq/library.rst:703
692+ #: ../../faq/library.rst:709
688693msgid "What module should I use to help with generating HTML?"
689694msgstr ""
690695
691- #: ../../faq/library.rst:707
696+ #: ../../faq/library.rst:713
692697msgid ""
693698"You can find a collection of useful links on the `Web Programming wiki page "
694699"<https://wiki.python.org/moin/WebProgramming>`_."
695700msgstr ""
696701
697- #: ../../faq/library.rst:712
702+ #: ../../faq/library.rst:718
698703msgid "How do I send mail from a Python script?"
699704msgstr ""
700705
701- #: ../../faq/library.rst:714
706+ #: ../../faq/library.rst:720
702707msgid "Use the standard library module :mod:`smtplib`."
703708msgstr ""
704709
705- #: ../../faq/library.rst:716
710+ #: ../../faq/library.rst:722
706711msgid ""
707712"Here's a very simple interactive mail sender that uses it. This method will "
708713"work on any host that supports an SMTP listener. ::"
709714msgstr ""
710715
711- #: ../../faq/library.rst:736
716+ #: ../../faq/library.rst:742
712717msgid ""
713718"A Unix-only alternative uses sendmail. The location of the sendmail program "
714719"varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/"
715720"usr/sbin/sendmail``. The sendmail manual page will help you out. Here's "
716721"some sample code::"
717722msgstr ""
718723
719- #: ../../faq/library.rst:756
724+ #: ../../faq/library.rst:762
720725msgid "How do I avoid blocking in the connect() method of a socket?"
721726msgstr ""
722727
723- #: ../../faq/library.rst:758
728+ #: ../../faq/library.rst:764
724729msgid ""
725730"The :mod:`select` module is commonly used to help with asynchronous I/O on "
726731"sockets."
727732msgstr ""
728733
729- #: ../../faq/library.rst:761
734+ #: ../../faq/library.rst:767
730735msgid ""
731736"To prevent the TCP connect from blocking, you can set the socket to non-"
732737"blocking mode. Then when you do the :meth:`socket.connect`, you will either "
@@ -736,7 +741,7 @@ msgid ""
736741"values, so you're going to have to check what's returned on your system."
737742msgstr ""
738743
739- #: ../../faq/library.rst:768
744+ #: ../../faq/library.rst:774
740745msgid ""
741746"You can use the :meth:`socket.connect_ex` method to avoid creating an "
742747"exception. It will just return the errno value. To poll, you can call :"
@@ -745,102 +750,102 @@ msgid ""
745750"select` to check if it's writable."
746751msgstr ""
747752
748- #: ../../faq/library.rst:774
753+ #: ../../faq/library.rst:780
749754msgid ""
750755"The :mod:`asyncio` module provides a general purpose single-threaded and "
751756"concurrent asynchronous library, which can be used for writing non-blocking "
752757"network code. The third-party `Twisted <https://twistedmatrix.com/trac/>`_ "
753758"library is a popular and feature-rich alternative."
754759msgstr ""
755760
756- #: ../../faq/library.rst:782
761+ #: ../../faq/library.rst:788
757762msgid "Databases"
758763msgstr ""
759764
760- #: ../../faq/library.rst:785
765+ #: ../../faq/library.rst:791
761766msgid "Are there any interfaces to database packages in Python?"
762767msgstr ""
763768
764- #: ../../faq/library.rst:787
769+ #: ../../faq/library.rst:793
765770msgid "Yes."
766771msgstr "有的"
767772
768- #: ../../faq/library.rst:789
773+ #: ../../faq/library.rst:795
769774msgid ""
770775"Interfaces to disk-based hashes such as :mod:`DBM <dbm.ndbm>` and :mod:`GDBM "
771776"<dbm.gnu>` are also included with standard Python. There is also the :mod:"
772777"`sqlite3` module, which provides a lightweight disk-based relational "
773778"database."
774779msgstr ""
775780
776- #: ../../faq/library.rst:794
781+ #: ../../faq/library.rst:800
777782msgid ""
778783"Support for most relational databases is available. See the "
779784"`DatabaseProgramming wiki page <https://wiki.python.org/moin/"
780785"DatabaseProgramming>`_ for details."
781786msgstr ""
782787
783- #: ../../faq/library.rst:800
788+ #: ../../faq/library.rst:806
784789msgid "How do you implement persistent objects in Python?"
785790msgstr ""
786791
787- #: ../../faq/library.rst:802
792+ #: ../../faq/library.rst:808
788793msgid ""
789794"The :mod:`pickle` library module solves this in a very general way (though "
790795"you still can't store things like open files, sockets or windows), and the :"
791796"mod:`shelve` library module uses pickle and (g)dbm to create persistent "
792797"mappings containing arbitrary Python objects."
793798msgstr ""
794799
795- #: ../../faq/library.rst:809
800+ #: ../../faq/library.rst:815
796801msgid "Mathematics and Numerics"
797802msgstr ""
798803
799- #: ../../faq/library.rst:812
804+ #: ../../faq/library.rst:818
800805msgid "How do I generate random numbers in Python?"
801806msgstr ""
802807
803- #: ../../faq/library.rst:814
808+ #: ../../faq/library.rst:820
804809msgid ""
805810"The standard module :mod:`random` implements a random number generator. "
806811"Usage is simple::"
807812msgstr ""
808813
809- #: ../../faq/library.rst:820
814+ #: ../../faq/library.rst:826
810815msgid "This returns a random floating point number in the range [0, 1)."
811816msgstr ""
812817
813- #: ../../faq/library.rst:822
818+ #: ../../faq/library.rst:828
814819msgid ""
815820"There are also many other specialized generators in this module, such as:"
816821msgstr ""
817822
818- #: ../../faq/library.rst:824
823+ #: ../../faq/library.rst:830
819824msgid "``randrange(a, b)`` chooses an integer in the range [a, b)."
820825msgstr ""
821826
822- #: ../../faq/library.rst:825
827+ #: ../../faq/library.rst:831
823828msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)."
824829msgstr ""
825830
826- #: ../../faq/library.rst:826
831+ #: ../../faq/library.rst:832
827832msgid ""
828833"``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution."
829834msgstr ""
830835
831- #: ../../faq/library.rst:828
836+ #: ../../faq/library.rst:834
832837msgid "Some higher-level functions operate on sequences directly, such as:"
833838msgstr ""
834839
835- #: ../../faq/library.rst:830
840+ #: ../../faq/library.rst:836
836841msgid "``choice(S)`` chooses a random element from a given sequence."
837842msgstr ""
838843
839- #: ../../faq/library.rst:831
844+ #: ../../faq/library.rst:837
840845msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly."
841846msgstr ""
842847
843- #: ../../faq/library.rst:833
848+ #: ../../faq/library.rst:839
844849msgid ""
845850"There's also a ``Random`` class you can instantiate to create independent "
846851"multiple random number generators."