From 42e8313f71572bcf475dc4517f9a70af82527e2f Mon Sep 17 00:00:00 2001 From: meowmeowcat Date: Thu, 24 Jun 2021 17:59:47 +0800 Subject: [PATCH 1/6] Translate tutorial/appendix.po --- tutorial/appendix.po | 59 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 9d68914fe4..f3e37033aa 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2017-09-22 18:27+0000\n" +"PO-Revision-Date: 2021-06-24 17:59+0800\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,6 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0\n" #: ../../tutorial/appendix.rst:5 msgid "Appendix" @@ -29,7 +30,7 @@ msgstr "互動模式" #: ../../tutorial/appendix.rst:16 msgid "Error Handling" -msgstr "" +msgstr "錯誤處理" #: ../../tutorial/appendix.rst:18 msgid "" @@ -43,6 +44,12 @@ msgid "" "messages are written to the standard error stream; normal output from " "executed commands is written to standard output." msgstr "" +"當一個錯誤發生時,直譯器會打印一個錯誤信息和堆棧跟踪。在交互式模式下,它將返" +"回主提示符;當輸入來自文件時,它在打印堆棧跟踪後以非零退出狀態退出。 (由\\ :" +"keyword:`except`\\ 子句在 \\ :keyword:`try`\\ 語句中處理的異常在這種情況下不" +"是錯誤。) 有些錯誤是無條件致命的,會導致非零退出;這適用於內部不一致和一些內" +"存耗盡的情況。所有的錯誤信息都被寫入標準錯誤流;被執行命令的正常輸出被寫入標" +"準輸出。" #: ../../tutorial/appendix.rst:28 msgid "" @@ -52,16 +59,24 @@ msgid "" "the :exc:`KeyboardInterrupt` exception, which may be handled by a :keyword:" "`try` statement." msgstr "" +"向主提示符或副提示符輸入中斷字符(通常是\\ :kbd:`Control-C`\\ 或\\ :kbd:" +"`Delete`\\ )會取消輸入並返回到主提示符。 [#]_ 在命令執行過程中輸入一個中斷," +"會引發\\ :ex:`KeyboardInterrupt`\\ 異常,但可以通過\\ :keyword:`try`\\ 語句來" +"處理。" #: ../../tutorial/appendix.rst:38 msgid "Executable Python Scripts" -msgstr "" +msgstr "可執行的 Python 腳本" #: ../../tutorial/appendix.rst:40 msgid "" "On BSD'ish Unix systems, Python scripts can be made directly executable, " "like shell scripts, by putting the line ::" msgstr "" +"在 BSD’ish Unix 系統上,Python 腳本可以直接執行,就像 shell 腳本一樣,通過放" +"置以下行:\n" +"\n" +"::" #: ../../tutorial/appendix.rst:45 msgid "" @@ -72,12 +87,16 @@ msgid "" "(``'\\r\\n'``) line ending. Note that the hash, or pound, character, " "``'#'``, is used to start a comment in Python." msgstr "" +"(假設直譯器在用戶的 \\ :envvar:`PATH`\\ 上)在腳本的開頭並給文件一個可執行" +"模式。 ``#!`` 必須是文件的前兩個字符。 在某些平台上,第一行必須以 Unix 樣式的" +"行結尾 (``’\\n’``) 結尾,而不是 Windows (``’\\r\\n’``) 行結尾。 請注意,井" +"號“‘#”用於在 Python 中開始註釋。" #: ../../tutorial/appendix.rst:52 msgid "" "The script can be given an executable mode, or permission, using the :" "program:`chmod` command." -msgstr "" +msgstr "可以使用\\ :program:`chmod`\\ 命令為腳本賦予可執行模式或權限。" #: ../../tutorial/appendix.rst:59 msgid "" @@ -87,10 +106,13 @@ msgid "" "extension can also be ``.pyw``, in that case, the console window that " "normally appears is suppressed." msgstr "" +"在Windows系統上,沒有「可執行模式」的概念。 Python安裝程序會自動將``.py``文件" +"與``python.exe``聯繫起來,這樣雙擊Python文件就會作為腳本運行。擴展名也可以是" +"`.pyw``,在這種情況下,通常出現的控制台窗口會被抑制了。" #: ../../tutorial/appendix.rst:69 msgid "The Interactive Startup File" -msgstr "" +msgstr "交互式啟動文件" #: ../../tutorial/appendix.rst:71 msgid "" @@ -100,6 +122,9 @@ msgid "" "the name of a file containing your start-up commands. This is similar to " "the :file:`.profile` feature of the Unix shells." msgstr "" +"當你交互式地使用 Python 時,每次啟動解釋器時執行一些標準命令是非常方便的。你" +"可以通過設置一個名為\\ :envvar:`PYTHONSTARTUP`\\ 的環境變量來實現,該變量是" +"一個包含啟動命令的文件名。這類似於Unix shells的\\ :file:`.profile`\\ 功能。" #: ../../tutorial/appendix.rst:77 msgid "" @@ -111,6 +136,10 @@ msgid "" "qualification in the interactive session. You can also change the prompts " "``sys.ps1`` and ``sys.ps2`` in this file." msgstr "" +"這個文件只在交互式會話中被讀取,而不是當Python 從腳本中讀取命令時,也不是當" +"\\ :file:`/dev/tty`\\ 被作為命令的明確來源時(否則表現得像一個交互式會話)。它" +"在執行交互式命令的同一命名空間中執行,因此它所定義或導入的對象可以在交互式會" +"話中不加限定地使用。你也可以在這個文件中改變``sys.ps1``和``sys.ps2``的提示。" #: ../../tutorial/appendix.rst:85 msgid "" @@ -120,10 +149,15 @@ msgid "" "want to use the startup file in a script, you must do this explicitly in the " "script::" msgstr "" +"如果你想從當前目錄中讀取一個額外的啟動文件,你可以在全局啟動文件中使用類似" +"``if os.path.isfile(‘.pythonrc.py’): exec(open(‘.pythonrc.py ‘).read()``的代" +"碼進行編程。如果你想在一個腳本中使用啟動文件,你必須在腳本中明確地這樣做:\n" +"\n" +"::" #: ../../tutorial/appendix.rst:102 msgid "The Customization Modules" -msgstr "" +msgstr "自定義模組" #: ../../tutorial/appendix.rst:104 msgid "" @@ -132,6 +166,11 @@ msgid "" "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" +"Python提供了兩個鉤子(Hooks)讓你自定義: \\ :mod:`sitecustomize`\\ 和 \\ :" +"mod:`usercustomize`\\ 。要看它是如何工作的,你首先需要找到你的 site-packages " +"的位置。啟動Python並運行這段代碼:\n" +"\n" +"::" #: ../../tutorial/appendix.rst:112 msgid "" @@ -140,6 +179,9 @@ msgid "" "unless it is started with the :option:`-s` option to disable the automatic " "import." msgstr "" +"現在,您可以在該目錄中創建一個名為 \\ :file:`usercustomize.py`\\ 的文件,並" +"將您想要的任何內容放入其中。 它會影響 Python 的每次調用,除非它以 \\ :option:" +"`-s`\\ 選項啟動以禁用自動導入。" #: ../../tutorial/appendix.rst:116 msgid "" @@ -148,6 +190,9 @@ msgid "" "imported before :mod:`usercustomize`. See the documentation of the :mod:" "`site` module for more details." msgstr "" +"\\ :mod:`sitecustomize`\\ 的工作方式相同,但通常是由計算機的管理員在全局 " +"site-packages目錄下創建,並在\\ :mod:`usercustomize`\\ 之前導入。更多細節請參" +"閱\\ :mod:`site`\\ 模塊的文檔。" #: ../../tutorial/appendix.rst:123 msgid "Footnotes" @@ -155,4 +200,4 @@ msgstr "註解" #: ../../tutorial/appendix.rst:124 msgid "A problem with the GNU Readline package may prevent this." -msgstr "" +msgstr "GNU Readline軟件包的一個問題可能會阻止這一點。" From 63b4f2391590def9ab38d11c671e9ed1861a72d8 Mon Sep 17 00:00:00 2001 From: meowmeowcat Date: Thu, 24 Jun 2021 19:48:27 +0800 Subject: [PATCH 2/6] Translate tutorial/appendix.po --- tutorial/appendix.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index f3e37033aa..e155744370 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-06-24 17:59+0800\n" +"PO-Revision-Date: 2021-06-24 19:38+0800\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -61,8 +61,8 @@ msgid "" msgstr "" "向主提示符或副提示符輸入中斷字符(通常是\\ :kbd:`Control-C`\\ 或\\ :kbd:" "`Delete`\\ )會取消輸入並返回到主提示符。 [#]_ 在命令執行過程中輸入一個中斷," -"會引發\\ :ex:`KeyboardInterrupt`\\ 異常,但可以通過\\ :keyword:`try`\\ 語句來" -"處理。" +"會引發\\ :exc:`KeyboardInterrupt`\\ 異常,但可以通過\\ :keyword:`try`\\ 語句" +"來處理。" #: ../../tutorial/appendix.rst:38 msgid "Executable Python Scripts" From 354e09bea17319f93df90416cc3b4836c7ef5c71 Mon Sep 17 00:00:00 2001 From: meowmeowcat Date: Fri, 25 Jun 2021 17:10:07 +0800 Subject: [PATCH 3/6] Update Project-Id-Version --- tutorial/appendix.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index e155744370..374459687c 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-06-24 19:38+0800\n" From e00c7c9af1fa88cd00687b3633a6fa04616556d5 Mon Sep 17 00:00:00 2001 From: meowmeowcat Date: Fri, 25 Jun 2021 20:22:33 +0800 Subject: [PATCH 4/6] Update appendix.po --- tutorial/appendix.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 374459687c..a97e45ce18 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-06-24 19:38+0800\n" -"Last-Translator: Leon H.\n" +"PO-Revision-Date: 2021-06-25 20:22+0800\n" +"Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" From 88f31a735de04025cd167b39ef31b82b12e99e20 Mon Sep 17 00:00:00 2001 From: meowmeowcat <68463158+meowmeowmeowcat@users.noreply.github.com> Date: Tue, 29 Jun 2021 16:35:50 +0800 Subject: [PATCH 5/6] Update tutorial/appendix.po --- tutorial/appendix.po | 68 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index a97e45ce18..61e308bf19 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-06-25 20:22+0800\n" +"PO-Revision-Date: 2021-06-29 16:05+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -44,12 +44,12 @@ msgid "" "messages are written to the standard error stream; normal output from " "executed commands is written to standard output." msgstr "" -"當一個錯誤發生時,直譯器會打印一個錯誤信息和堆棧跟踪。在交互式模式下,它將返" -"回主提示符;當輸入來自文件時,它在打印堆棧跟踪後以非零退出狀態退出。 (由\\ :" -"keyword:`except`\\ 子句在 \\ :keyword:`try`\\ 語句中處理的異常在這種情況下不" -"是錯誤。) 有些錯誤是無條件致命的,會導致非零退出;這適用於內部不一致和一些內" -"存耗盡的情況。所有的錯誤信息都被寫入標準錯誤流;被執行命令的正常輸出被寫入標" -"準輸出。" +"當一個錯誤發生時,直譯器會印出一個錯誤訊息和堆疊回溯。在互動模式下,它將返回" +"主提示字元;當輸入來自檔案時,它在印出堆疊回溯後以非零退出狀態退出。 (由 :" +"keyword:`except` 子句在 :keyword:`try` 陳述式中處理的例外在這種情況下" +"不是錯誤。) 有些錯誤是無條件嚴重的,會導致非零退出;這適用於內部不一致和一些" +"記憶體耗盡的情況。所有的錯誤訊息都被寫入標準錯誤輸出;被執行命令的正常輸出被" +"寫入標準輸出。" #: ../../tutorial/appendix.rst:28 msgid "" @@ -59,9 +59,9 @@ msgid "" "the :exc:`KeyboardInterrupt` exception, which may be handled by a :keyword:" "`try` statement." msgstr "" -"向主提示符或副提示符輸入中斷字符(通常是\\ :kbd:`Control-C`\\ 或\\ :kbd:" -"`Delete`\\ )會取消輸入並返回到主提示符。 [#]_ 在命令執行過程中輸入一個中斷," -"會引發\\ :exc:`KeyboardInterrupt`\\ 異常,但可以通過\\ :keyword:`try`\\ 語句" +"向主提示字元或次提示字元輸入中斷字元(通常是 :kbd:`Control-C` 或 :kbd:" +"`Delete` )會取消輸入並返回到主提示字元。 [#]_ 在命令執行過程中輸入一個中斷," +"會引發 :exc:`KeyboardInterrupt` 例外,但可以通過 :keyword:`try` 陳述式" "來處理。" #: ../../tutorial/appendix.rst:38 @@ -87,16 +87,16 @@ msgid "" "(``'\\r\\n'``) line ending. Note that the hash, or pound, character, " "``'#'``, is used to start a comment in Python." msgstr "" -"(假設直譯器在用戶的 \\ :envvar:`PATH`\\ 上)在腳本的開頭並給文件一個可執行" -"模式。 ``#!`` 必須是文件的前兩個字符。 在某些平台上,第一行必須以 Unix 樣式的" +"(假設直譯器在用戶的 :envvar:`PATH` 上)在腳本的開頭並給檔案一個可執行" +"模式。 ``#!`` 必須是檔案的前兩個字符。 在某些平台上,第一行必須以 Unix 樣式的" "行結尾 (``’\\n’``) 結尾,而不是 Windows (``’\\r\\n’``) 行結尾。 請注意,井" -"號“‘#”用於在 Python 中開始註釋。" +"號 ``'#'`` 用於在 Python 中開始註釋。" #: ../../tutorial/appendix.rst:52 msgid "" "The script can be given an executable mode, or permission, using the :" "program:`chmod` command." -msgstr "可以使用\\ :program:`chmod`\\ 命令為腳本賦予可執行模式或權限。" +msgstr "可以使用 :program:`chmod` 命令為腳本賦予可執行模式或權限。" #: ../../tutorial/appendix.rst:59 msgid "" @@ -106,13 +106,13 @@ msgid "" "extension can also be ``.pyw``, in that case, the console window that " "normally appears is suppressed." msgstr "" -"在Windows系統上,沒有「可執行模式」的概念。 Python安裝程序會自動將``.py``文件" -"與``python.exe``聯繫起來,這樣雙擊Python文件就會作為腳本運行。擴展名也可以是" -"`.pyw``,在這種情況下,通常出現的控制台窗口會被抑制了。" +"在 Windows 系統上,沒有「\ 可執行模式\ 」的概念。 Python 安裝程序會自動將 ``.py`` 檔案" +"與 ``python.exe`` 聯繫起來,這樣雙擊 Python 檔案就會作為腳本運行。擴展名也可以是" +" ``.pyw``,在這種情況下,通常出現的控制台窗口會被抑制了。" #: ../../tutorial/appendix.rst:69 msgid "The Interactive Startup File" -msgstr "交互式啟動文件" +msgstr "交互式啟動檔案" #: ../../tutorial/appendix.rst:71 msgid "" @@ -123,8 +123,8 @@ msgid "" "the :file:`.profile` feature of the Unix shells." msgstr "" "當你交互式地使用 Python 時,每次啟動解釋器時執行一些標準命令是非常方便的。你" -"可以通過設置一個名為\\ :envvar:`PYTHONSTARTUP`\\ 的環境變量來實現,該變量是" -"一個包含啟動命令的文件名。這類似於Unix shells的\\ :file:`.profile`\\ 功能。" +"可以通過設置一個名為 :envvar:`PYTHONSTARTUP` 的環境變量來實現,該變量是" +"一個包含啟動命令的檔案名。這類似於 Unix shells 的 :file:`.profile` 功能。" #: ../../tutorial/appendix.rst:77 msgid "" @@ -136,10 +136,10 @@ msgid "" "qualification in the interactive session. You can also change the prompts " "``sys.ps1`` and ``sys.ps2`` in this file." msgstr "" -"這個文件只在交互式會話中被讀取,而不是當Python 從腳本中讀取命令時,也不是當" -"\\ :file:`/dev/tty`\\ 被作為命令的明確來源時(否則表現得像一個交互式會話)。它" +"這個檔案只在交互式會話中被讀取,而不是當Python 從腳本中讀取命令時,也不是當" +" :file:`/dev/tty` 被作為命令的明確來源時(否則表現得像一個交互式會話)。它" "在執行交互式命令的同一命名空間中執行,因此它所定義或導入的對象可以在交互式會" -"話中不加限定地使用。你也可以在這個文件中改變``sys.ps1``和``sys.ps2``的提示。" +"話中不加限定地使用。你也可以在這個檔案中改變 ``sys.ps1`` 和 ``sys.ps2`` 的提示。" #: ../../tutorial/appendix.rst:85 msgid "" @@ -149,9 +149,9 @@ msgid "" "want to use the startup file in a script, you must do this explicitly in the " "script::" msgstr "" -"如果你想從當前目錄中讀取一個額外的啟動文件,你可以在全局啟動文件中使用類似" -"``if os.path.isfile(‘.pythonrc.py’): exec(open(‘.pythonrc.py ‘).read()``的代" -"碼進行編程。如果你想在一個腳本中使用啟動文件,你必須在腳本中明確地這樣做:\n" +"如果你想從當前目錄中讀取一個額外的啟動檔案,你可以在全局啟動檔案中使用類似" +" ``if os.path.isfile(‘.pythonrc.py’): exec(open(‘.pythonrc.py ‘).read()`` 的代" +"碼進行編程。如果你想在一個腳本中使用啟動檔案,你必須在腳本中明確地這樣做:\n" "\n" "::" @@ -166,8 +166,8 @@ msgid "" "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" -"Python提供了兩個鉤子(Hooks)讓你自定義: \\ :mod:`sitecustomize`\\ 和 \\ :" -"mod:`usercustomize`\\ 。要看它是如何工作的,你首先需要找到你的 site-packages " +"Python提供了兩個鉤子(Hooks)讓你自定義: :mod:`sitecustomize` 和 :" +"mod:`usercustomize` 。要看它是如何工作的,你首先需要找到你的 site-packages " "的位置。啟動Python並運行這段代碼:\n" "\n" "::" @@ -179,9 +179,9 @@ msgid "" "unless it is started with the :option:`-s` option to disable the automatic " "import." msgstr "" -"現在,您可以在該目錄中創建一個名為 \\ :file:`usercustomize.py`\\ 的文件,並" -"將您想要的任何內容放入其中。 它會影響 Python 的每次調用,除非它以 \\ :option:" -"`-s`\\ 選項啟動以禁用自動導入。" +"現在,您可以在該目錄中創建一個名為 :file:`usercustomize.py` 的檔案,並" +"將您想要的任何內容放入其中。 它會影響 Python 的每次調用,除非它以 :option:" +"`-s` 選項啟動以禁用自動導入。" #: ../../tutorial/appendix.rst:116 msgid "" @@ -190,9 +190,9 @@ msgid "" "imported before :mod:`usercustomize`. See the documentation of the :mod:" "`site` module for more details." msgstr "" -"\\ :mod:`sitecustomize`\\ 的工作方式相同,但通常是由計算機的管理員在全局 " -"site-packages目錄下創建,並在\\ :mod:`usercustomize`\\ 之前導入。更多細節請參" -"閱\\ :mod:`site`\\ 模塊的文檔。" +" :mod:`sitecustomize` 的工作方式相同,但通常是由計算機的管理員在全局 " +" site-packages 目錄下創建,並在 :mod:`usercustomize` 之前導入。更多細節請參" +"閱 :mod:`site` 模塊的文檔。" #: ../../tutorial/appendix.rst:123 msgid "Footnotes" From f1cd11f956da5510acea061362aa4adb84f58d1a Mon Sep 17 00:00:00 2001 From: meowmeowcat <68463158+meowmeowmeowcat@users.noreply.github.com> Date: Mon, 5 Jul 2021 14:43:41 +0800 Subject: [PATCH 6/6] Update tutorial/appendix.po --- tutorial/appendix.po | 82 +++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 61e308bf19..d1b5c88b74 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" -"PO-Revision-Date: 2021-06-29 16:05+0800\n" +"PO-Revision-Date: 2021-07-05 14:35+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -46,10 +46,10 @@ msgid "" msgstr "" "當一個錯誤發生時,直譯器會印出一個錯誤訊息和堆疊回溯。在互動模式下,它將返回" "主提示字元;當輸入來自檔案時,它在印出堆疊回溯後以非零退出狀態退出。 (由 :" -"keyword:`except` 子句在 :keyword:`try` 陳述式中處理的例外在這種情況下" -"不是錯誤。) 有些錯誤是無條件嚴重的,會導致非零退出;這適用於內部不一致和一些" -"記憶體耗盡的情況。所有的錯誤訊息都被寫入標準錯誤輸出;被執行命令的正常輸出被" -"寫入標準輸出。" +"keyword:`except` 子句在 :keyword:`try` 陳述式中處理的例外在這種情況下不是錯" +"誤。) 有些錯誤是無條件嚴重的,會導致非零退出;這適用於內部不一致和一些記憶體" +"耗盡的情況。所有的錯誤訊息都被寫入標準錯誤輸出;被執行指令的正常輸出被寫入標" +"準輸出。" #: ../../tutorial/appendix.rst:28 msgid "" @@ -60,9 +60,9 @@ msgid "" "`try` statement." msgstr "" "向主提示字元或次提示字元輸入中斷字元(通常是 :kbd:`Control-C` 或 :kbd:" -"`Delete` )會取消輸入並返回到主提示字元。 [#]_ 在命令執行過程中輸入一個中斷," -"會引發 :exc:`KeyboardInterrupt` 例外,但可以通過 :keyword:`try` 陳述式" -"來處理。" +"`Delete` )會取消輸入並返回到主提示字元。 [#]_ 在指令執行過程中輸入一個中斷," +"會引發 :exc:`KeyboardInterrupt` 例外,但可以通過 :keyword:`try` 陳述式來處" +"理。" #: ../../tutorial/appendix.rst:38 msgid "Executable Python Scripts" @@ -73,8 +73,8 @@ msgid "" "On BSD'ish Unix systems, Python scripts can be made directly executable, " "like shell scripts, by putting the line ::" msgstr "" -"在 BSD’ish Unix 系統上,Python 腳本可以直接執行,就像 shell 腳本一樣,通過放" -"置以下行:\n" +"在類 BSD 的 Unix 系統上,Python 腳本可以直接執行,就像 shell 腳本一樣,通過放" +"置以下這行:\n" "\n" "::" @@ -87,16 +87,16 @@ msgid "" "(``'\\r\\n'``) line ending. Note that the hash, or pound, character, " "``'#'``, is used to start a comment in Python." msgstr "" -"(假設直譯器在用戶的 :envvar:`PATH` 上)在腳本的開頭並給檔案一個可執行" -"模式。 ``#!`` 必須是檔案的前兩個字符。 在某些平台上,第一行必須以 Unix 樣式的" -"行結尾 (``’\\n’``) 結尾,而不是 Windows (``’\\r\\n’``) 行結尾。 請注意,井" -"號 ``'#'`` 用於在 Python 中開始註釋。" +"(假設直譯器在用戶的 :envvar:`PATH` 上)在腳本的開頭並給檔案一個可執行模式。 " +"``#!`` 必須是檔案的前兩個字元。 在某些平台上,第一行必須以 Unix 樣式的換行 " +"(``’\\n’``) 結尾,而不是 Windows (``’\\r\\n’``) 換行。 請注意,井號 " +"``'#'`` 用於在 Python 中開始註解。" #: ../../tutorial/appendix.rst:52 msgid "" "The script can be given an executable mode, or permission, using the :" "program:`chmod` command." -msgstr "可以使用 :program:`chmod` 命令為腳本賦予可執行模式或權限。" +msgstr "可以使用 :program:`chmod` 指令為腳本賦予可執行模式或權限。" #: ../../tutorial/appendix.rst:59 msgid "" @@ -106,13 +106,13 @@ msgid "" "extension can also be ``.pyw``, in that case, the console window that " "normally appears is suppressed." msgstr "" -"在 Windows 系統上,沒有「\ 可執行模式\ 」的概念。 Python 安裝程序會自動將 ``.py`` 檔案" -"與 ``python.exe`` 聯繫起來,這樣雙擊 Python 檔案就會作為腳本運行。擴展名也可以是" -" ``.pyw``,在這種情況下,通常出現的控制台窗口會被抑制了。" +"在 Windows 系統上,沒有「可執行模式」的概念。 Python 安裝程式會自動將 ``." +"py`` 檔案與 ``python.exe`` 聯繫起來,這樣雙擊 Python 檔案就會作為腳本運行。副" +"檔名也可以是 ``.pyw``,在這種情況下,通常會出現的控制台視窗會被隱藏。" #: ../../tutorial/appendix.rst:69 msgid "The Interactive Startup File" -msgstr "交互式啟動檔案" +msgstr "互動式啟動檔案" #: ../../tutorial/appendix.rst:71 msgid "" @@ -122,9 +122,9 @@ msgid "" "the name of a file containing your start-up commands. This is similar to " "the :file:`.profile` feature of the Unix shells." msgstr "" -"當你交互式地使用 Python 時,每次啟動解釋器時執行一些標準命令是非常方便的。你" -"可以通過設置一個名為 :envvar:`PYTHONSTARTUP` 的環境變量來實現,該變量是" -"一個包含啟動命令的檔案名。這類似於 Unix shells 的 :file:`.profile` 功能。" +"當你互動式地使用 Python 時,每次啟動直譯器時執行一些標準指令是非常方便的。你" +"可以通過設置一個名為 :envvar:`PYTHONSTARTUP` 的環境變數來實現,該變數是一個包" +"含啟動指令的檔案名。它的功能類似 Unix shell 的 :file:`.profile` 。" #: ../../tutorial/appendix.rst:77 msgid "" @@ -136,10 +136,11 @@ msgid "" "qualification in the interactive session. You can also change the prompts " "``sys.ps1`` and ``sys.ps2`` in this file." msgstr "" -"這個檔案只在交互式會話中被讀取,而不是當Python 從腳本中讀取命令時,也不是當" -" :file:`/dev/tty` 被作為命令的明確來源時(否則表現得像一個交互式會話)。它" -"在執行交互式命令的同一命名空間中執行,因此它所定義或導入的對象可以在交互式會" -"話中不加限定地使用。你也可以在這個檔案中改變 ``sys.ps1`` 和 ``sys.ps2`` 的提示。" +"這個檔案只在互動模式中被讀取,當 Python 從腳本中讀取指令時,此檔案不會被讀" +"取,當 :file: `/dev/tty` 作為指令的明確來源時也不會(否則表現得像互動模式)。" +"它在執行互動式指令的同一命名空間中執行,因此它所定義或 import 的物件可以在互" +"動模式中不加限定地使用。你也可以在這個檔案中改變 ``sys.ps1`` 和 ``sys.ps2`` " +"等提示字元。" #: ../../tutorial/appendix.rst:85 msgid "" @@ -149,15 +150,16 @@ msgid "" "want to use the startup file in a script, you must do this explicitly in the " "script::" msgstr "" -"如果你想從當前目錄中讀取一個額外的啟動檔案,你可以在全局啟動檔案中使用類似" -" ``if os.path.isfile(‘.pythonrc.py’): exec(open(‘.pythonrc.py ‘).read()`` 的代" -"碼進行編程。如果你想在一個腳本中使用啟動檔案,你必須在腳本中明確地這樣做:\n" +"如果你想從當前目錄中讀取一個額外的啟動檔案,你可以在全域啟動檔案中使用類似 " +"``if os.path.isfile(‘.pythonrc.py’): exec(open(‘.pythonrc.py ‘).read()`` 的程" +"式碼設定這個行為。如果你想在一個腳本中使用啟動檔案,你必須在腳本中明確地這樣" +"做:\n" "\n" "::" #: ../../tutorial/appendix.rst:102 msgid "The Customization Modules" -msgstr "自定義模組" +msgstr "客製化模組" #: ../../tutorial/appendix.rst:104 msgid "" @@ -166,9 +168,9 @@ msgid "" "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" -"Python提供了兩個鉤子(Hooks)讓你自定義: :mod:`sitecustomize` 和 :" -"mod:`usercustomize` 。要看它是如何工作的,你首先需要找到你的 site-packages " -"的位置。啟動Python並運行這段代碼:\n" +"Python 提供了兩個鉤子(hook)讓你可以將它客製化: :mod:`sitecustomize` 和 :" +"mod:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages 的" +"位置。啟動 Python 並運行這段程式碼:\n" "\n" "::" @@ -179,9 +181,9 @@ msgid "" "unless it is started with the :option:`-s` option to disable the automatic " "import." msgstr "" -"現在,您可以在該目錄中創建一個名為 :file:`usercustomize.py` 的檔案,並" -"將您想要的任何內容放入其中。 它會影響 Python 的每次調用,除非它以 :option:" -"`-s` 選項啟動以禁用自動導入。" +"現在,您可以在該目錄中創建一個名為 :file:`usercustomize.py` 的檔案,並將您想" +"要的任何內容放入其中。它會影響 Python 的每次呼叫,除非它以 :option:`-s` 選項" +"啟動以禁用自動 import 。" #: ../../tutorial/appendix.rst:116 msgid "" @@ -190,9 +192,9 @@ msgid "" "imported before :mod:`usercustomize`. See the documentation of the :mod:" "`site` module for more details." msgstr "" -" :mod:`sitecustomize` 的工作方式相同,但通常是由計算機的管理員在全局 " -" site-packages 目錄下創建,並在 :mod:`usercustomize` 之前導入。更多細節請參" -"閱 :mod:`site` 模塊的文檔。" +":mod:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" +"packages 目錄下創建,並在 :mod:`usercustomize` 之前 import 。更多細節請參閱 :mod:" +"`site` 模組的文件。" #: ../../tutorial/appendix.rst:123 msgid "Footnotes" @@ -200,4 +202,4 @@ msgstr "註解" #: ../../tutorial/appendix.rst:124 msgid "A problem with the GNU Readline package may prevent this." -msgstr "GNU Readline軟件包的一個問題可能會阻止這一點。" +msgstr "GNU Readline 套件的一個問題可能會阻止這一點。"