Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1b45b9

Browse files
committed
[po] auto sync bot
1 parent 9ae72cc commit c1b45b9

2 files changed

Lines changed: 52 additions & 17 deletions

File tree

faq/library.po

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -711,93 +711,106 @@ msgid ""
711711
"marks the Python-level file object as being closed, but does *not* close the"
712712
" associated C file descriptor."
713713
msgstr ""
714+
"但由于 stdin,stdout 和 stderr 在 C 中的特殊地位,在 Python 中也会对它们做特殊处理。运行 "
715+
"``sys.stdout.close()`` 会将 Python 的文件对象标记为已关闭,但是*不会*关闭与之关联的文件描述符。"
714716

715717
#: ../../faq/library.rst:646
716718
msgid ""
717719
"To close the underlying C file descriptor for one of these three, you should"
718720
" first be sure that's what you really want to do (e.g., you may confuse "
719721
"extension modules trying to do I/O). If it is, use :func:`os.close`::"
720722
msgstr ""
723+
"要关闭这三者的 C 文件描述符的话,首先你应该确认确实需要关闭它(比如,这可能会影响到处理 I/O 的拓展)。如果确实需要这么做的话,使用 "
724+
":func:`os.close`:"
721725

722726
#: ../../faq/library.rst:654
723727
msgid "Or you can use the numeric constants 0, 1 and 2, respectively."
724-
msgstr ""
728+
msgstr "或者也可以使用常量 0,1,2 代替。"
725729

726730
#: ../../faq/library.rst:658
727731
msgid "Network/Internet Programming"
728-
msgstr ""
732+
msgstr "网络 / Internet 编程"
729733

730734
#: ../../faq/library.rst:661
731735
msgid "What WWW tools are there for Python?"
732-
msgstr ""
736+
msgstr "Python 中的 WWW 工具是什么?"
733737

734738
#: ../../faq/library.rst:663
735739
msgid ""
736740
"See the chapters titled :ref:`internet` and :ref:`netdata` in the Library "
737741
"Reference Manual. Python has many modules that will help you build server-"
738742
"side and client-side web systems."
739743
msgstr ""
744+
"参阅代码库参考手册中 :ref:`internet` 和 :ref:`netdata` 这两章的内容。Python 有大量模块来帮助你构建服务端和客户端"
745+
" web 系统。"
740746

741747
#: ../../faq/library.rst:669
742748
msgid ""
743749
"A summary of available frameworks is maintained by Paul Boddie at "
744750
"https://wiki.python.org/moin/WebProgramming\\ ."
745751
msgstr ""
752+
"Paul Boddie 维护了一份可用框架的概览,见 https://wiki.python.org/moin/WebProgramming 。"
746753

747754
#: ../../faq/library.rst:672
748755
msgid ""
749756
"Cameron Laird maintains a useful set of pages about Python web technologies "
750757
"at http://phaseit.net/claird/comp.lang.python/web_python."
751758
msgstr ""
759+
"Cameron Laird 维护了一份关于 Python web 技术的实用网页的集合,见 "
760+
"http://phaseit.net/claird/comp.lang.python/web_python 。"
752761

753762
#: ../../faq/library.rst:677
754763
msgid "How can I mimic CGI form submission (METHOD=POST)?"
755-
msgstr ""
764+
msgstr "怎样模拟发送 CGI 表单(METHOD=POST)?"
756765

757766
#: ../../faq/library.rst:679
758767
msgid ""
759768
"I would like to retrieve web pages that are the result of POSTing a form. Is"
760769
" there existing code that would let me do this easily?"
761-
msgstr ""
770+
msgstr "我需要通过 POST 表单获取网页,有什么代码能简单做到吗?"
762771

763772
#: ../../faq/library.rst:682
764773
msgid "Yes. Here's a simple example that uses urllib.request::"
765-
msgstr ""
774+
msgstr "是的,这里有一个使用 urllib.request 的简单例子:"
766775

767776
#: ../../faq/library.rst:697
768777
msgid ""
769778
"Note that in general for percent-encoded POST operations, query strings must"
770779
" be quoted using :func:`urllib.parse.urlencode`. For example, to send "
771780
"``name=Guy Steele, Jr.``::"
772781
msgstr ""
782+
"注意,通常在百分号编码的 POST 操作中,查询字符串必须使用 :func:`urllib.parse.urlencode` "
783+
"处理一下。举个例子,如果要发送 ``name=Guy Steele, Jr.`` 的话:"
773784

774785
#: ../../faq/library.rst:705
775786
msgid ":ref:`urllib-howto` for extensive examples."
776-
msgstr ""
787+
msgstr "查看 :ref:`urllib-howto` 获取更多示例。"
777788

778789
#: ../../faq/library.rst:709
779790
msgid "What module should I use to help with generating HTML?"
780-
msgstr ""
791+
msgstr "生成 HTML 需要使用什么模块?"
781792

782793
#: ../../faq/library.rst:713
783794
msgid ""
784795
"You can find a collection of useful links on the `Web Programming wiki page "
785796
"<https://wiki.python.org/moin/WebProgramming>`_."
786797
msgstr ""
798+
"你可以在 `Web 编程 wiki 页面 <https://wiki.python.org/moin/WebProgramming>`_ "
799+
"找到许多有用的链接。"
787800

788801
#: ../../faq/library.rst:718
789802
msgid "How do I send mail from a Python script?"
790-
msgstr ""
803+
msgstr "怎样使用 Python 脚本发送邮件?"
791804

792805
#: ../../faq/library.rst:720
793806
msgid "Use the standard library module :mod:`smtplib`."
794-
msgstr ""
807+
msgstr "使用 :mod:`smtplib` 标准库模块。"
795808

796809
#: ../../faq/library.rst:722
797810
msgid ""
798811
"Here's a very simple interactive mail sender that uses it. This method will"
799812
" work on any host that supports an SMTP listener. ::"
800-
msgstr ""
813+
msgstr "下面是一个很简单的交互式发送邮件的代码。这个方法适用于任何支持 SMTP 协议的主机。"
801814

802815
#: ../../faq/library.rst:742
803816
msgid ""
@@ -806,16 +819,19 @@ msgid ""
806819
"``/usr/sbin/sendmail``. The sendmail manual page will help you out. Here's"
807820
" some sample code::"
808821
msgstr ""
822+
"在 Unix 系统中还可以使用 sendmail。sendmail 程序的位置在不同系统中不一样,有时是在 "
823+
"``/usr/lib/sendmail``,有时是在 ``/usr/sbin/sendmail``。sendmail "
824+
"手册页面会对你有所帮助。以下是示例代码:"
809825

810826
#: ../../faq/library.rst:762
811827
msgid "How do I avoid blocking in the connect() method of a socket?"
812-
msgstr ""
828+
msgstr "socket 的 connect() 方法怎样避免阻塞?"
813829

814830
#: ../../faq/library.rst:764
815831
msgid ""
816832
"The :mod:`select` module is commonly used to help with asynchronous I/O on "
817833
"sockets."
818-
msgstr ""
834+
msgstr "通常会用 :mod:`select` 模块处理 socket 异步 I/O。"
819835

820836
#: ../../faq/library.rst:767
821837
msgid ""
@@ -826,6 +842,9 @@ msgid ""
826842
"progress, but hasn't finished yet. Different OSes will return different "
827843
"values, so you're going to have to check what's returned on your system."
828844
msgstr ""
845+
"要避免 TCP 连接阻塞,你可以设置将 socket 设置为非阻塞模式。此时当调用 ``connect()`` "
846+
"时,要么连接会立刻建立好(几乎不可能),要么会收到一个包含了错误码 ``.error`` 的异常。``errno.EINPROGRESS`` "
847+
"表示连接正在进行,但还没有完成。不同的系统会返回不同的值,所以你需要确认你使用的系统会返回什么。"
829848

830849
#: ../../faq/library.rst:774
831850
msgid ""
@@ -834,6 +853,9 @@ msgid ""
834853
"again later -- ``0`` or ``errno.EISCONN`` indicate that you're connected -- "
835854
"or you can pass this socket to select to check if it's writable."
836855
msgstr ""
856+
"你可以使用 ``connect_ex()`` 方法来避免产生异常。这个方法只会返回错误码。如果需要轮询的话,你可以再次调用 "
857+
"``connect_ex()`` —— ``0`` 或 ``errno.EISCONN`` 表示连接已建立,或者你也可以用 select 检查这个 "
858+
"socket 是否可写。"
837859

838860
#: ../../faq/library.rst:780
839861
msgid ""
@@ -842,18 +864,20 @@ msgid ""
842864
"<https://twistedmatrix.com/trac/>`_ library is a popular and feature-rich "
843865
"alternative."
844866
msgstr ""
867+
":mod:`asyncore` 模块提供了编写非阻塞网络代码框架性的方法。第三方的 `Twisted "
868+
"<https://twistedmatrix.com/trac/>`_ 库也很常用且功能强大。"
845869

846870
#: ../../faq/library.rst:787
847871
msgid "Databases"
848-
msgstr ""
872+
msgstr "数据库"
849873

850874
#: ../../faq/library.rst:790
851875
msgid "Are there any interfaces to database packages in Python?"
852-
msgstr ""
876+
msgstr "Python 中有数据库包的接口吗?"
853877

854878
#: ../../faq/library.rst:792
855879
msgid "Yes."
856-
msgstr ""
880+
msgstr "当然。"
857881

858882
#: ../../faq/library.rst:794
859883
msgid ""
@@ -862,6 +886,8 @@ msgid ""
862886
":mod:`sqlite3` module, which provides a lightweight disk-based relational "
863887
"database."
864888
msgstr ""
889+
"Python 标准库中集成了基于磁盘的哈希数据库接口,例如 :mod:`DBM <dbm.ndbm>` 和 `mod:`GDBM "
890+
"<dbm.gnu>`。除此之外还有 :mod:`sqlite3` 模块,该模块提供了一个轻量级的基于磁盘的关系型数据库。"
865891

866892
#: ../../faq/library.rst:799
867893
msgid ""

tutorial/datastructures.po

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ msgstr ""
316316
#: ../../tutorial/datastructures.rst:372
317317
msgid ""
318318
"A tuple consists of a number of values separated by commas, for instance::"
319-
msgstr ""
319+
msgstr "一个元组由几个被逗号隔开的值组成,例如 ::"
320320

321321
#: ../../tutorial/datastructures.rst:394
322322
msgid ""
@@ -327,6 +327,7 @@ msgid ""
327327
" the individual items of a tuple, however it is possible to create tuples "
328328
"which contain mutable objects, such as lists."
329329
msgstr ""
330+
"如你所见,元组在输出是总是被圆括号包围的,以便正确表示嵌套元组。输入时圆括号可有可无,不过经常会是必须的(如果这个元组是一个更大的表达式的一部分)。给元组中的一个单独的元素赋值是不允许的,当然你可以创建包含可变对象的元组,例如包含列表。"
330331

331332
#: ../../tutorial/datastructures.rst:401
332333
msgid ""
@@ -338,6 +339,10 @@ msgid ""
338339
":term:`mutable`, and their elements are usually homogeneous and are accessed"
339340
" by iterating over the list."
340341
msgstr ""
342+
"虽然元组可能看起来与列表很像,但它们通常是在不同的场景被使用,并且有着不同的用途。元组是 :term:`immutable` "
343+
"(不可变的),其序列通常包含不同种类的元素,并且通过解包(这一节下面会解释)或者索引来访问(如果是 :func:`namedtuples "
344+
"<collections.namedtuple>` 的话甚至还可以通过属性访问)。列表是 :term:`mutable` "
345+
"(可变的),并且列表中的元素一般是同种类型的,并且通过迭代访问。"
341346

342347
#: ../../tutorial/datastructures.rst:409
343348
msgid ""
@@ -347,13 +352,17 @@ msgid ""
347352
"constructed by following a value with a comma (it is not sufficient to "
348353
"enclose a single value in parentheses). Ugly, but effective. For example::"
349354
msgstr ""
355+
"一个特殊的问题是构造包含0个或1个元素的元组:为了适应这种情况,语法有一些额外的改变。空元组可以直接被一对空圆括号创建,含有一个元素的元组可以通过在这个元素后添加一个逗号来构建(圆括号里只有一个值的话不够明确)。丑陋,但是有效。例如"
356+
" ::"
350357

351358
#: ../../tutorial/datastructures.rst:424
352359
msgid ""
353360
"The statement ``t = 12345, 54321, 'hello!'`` is an example of *tuple "
354361
"packing*: the values ``12345``, ``54321`` and ``'hello!'`` are packed "
355362
"together in a tuple. The reverse operation is also possible::"
356363
msgstr ""
364+
"语句 ``t = 12345, 54321, 'hello!'`` 是 *元组打包* 的一个例子:值 ``12345``, ``54321`` 和 "
365+
"``'hello!'`` 被打包进元组。其逆操作也是允许的 ::"
357366

358367
#: ../../tutorial/datastructures.rst:430
359368
msgid ""

0 commit comments

Comments
 (0)