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

Skip to content

Commit c38ff75

Browse files
Copilotjosix
andcommitted
Translate core sys module sections: path, version, exit functions
Co-authored-by: josix <[email protected]>
1 parent 502b66f commit c38ff75

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

library/sys.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ msgid ""
625625
"Raise a :exc:`SystemExit` exception, signaling an intention to exit the "
626626
"interpreter."
627627
msgstr ""
628+
"引發 :exc:`SystemExit` 例外,表示意圖退出直譯器。"
628629

629630
#: ../../library/sys.rst:504
630631
msgid ""
@@ -641,6 +642,7 @@ msgid ""
641642
"code of 1. In particular, ``sys.exit(\"some error message\")`` is a quick "
642643
"way to exit a program when an error occurs."
643644
msgstr ""
645+
"選擇性引數 *arg* 可以是給出退出狀態的整數(預設為零),或其他型別的物件。如果它是整數,零被 shell 等視為「成功終止」,任何非零值被視為「異常終止」。大多數系統要求它在 0-127 範圍內,否則會產生未定義的結果。某些系統有將特定含義分配給特定退出代碼的慣例,但這些通常不太成熟;Unix 程式通常使用 2 來表示命令列語法錯誤,使用 1 來表示所有其他類型的錯誤。如果傳遞了其他型別的物件,``None`` 等同於傳遞零,任何其他物件會被列印到 :data:`stderr` 並導致退出代碼為 1。特別是,``sys.exit(\"some error message\")`` 是在發生錯誤時退出程式的快速方法。"
644646

645647
#: ../../library/sys.rst:517
646648
msgid ""
@@ -650,6 +652,7 @@ msgid ""
650652
"statements are honored, and it is possible to intercept the exit attempt at "
651653
"an outer level."
652654
msgstr ""
655+
"由於 :func:`exit` 最終「只是」引發例外,它只有在從主執行緒呼叫且例外未被攔截時才會退出程序。:keyword:`try` 陳述式的 finally 子句中指定的清理動作會被執行,並且可以在外層攔截退出嘗試。"
653656

654657
#: ../../library/sys.rst:522
655658
msgid ""
@@ -1687,56 +1690,65 @@ msgid ""
16871690
"user's program. Arguments consumed by the interpreter itself will be present "
16881691
"in :data:`sys.orig_argv` and missing from :data:`sys.argv`."
16891692
msgstr ""
1693+
":data:`sys.orig_argv` 的元素是 Python 直譯器的引數,而 :data:`sys.argv` 的元素是使用者程式的引數。被直譯器本身消耗的引數會出現在 :data:`sys.orig_argv` 中,但在 :data:`sys.argv` 中會缺失。"
16901694

16911695
#: ../../library/sys.rst:1366
16921696
msgid ""
16931697
"A list of strings that specifies the search path for modules. Initialized "
16941698
"from the environment variable :envvar:`PYTHONPATH`, plus an installation-"
16951699
"dependent default."
16961700
msgstr ""
1701+
"指定模組搜尋路徑的字串清單。從環境變數 :envvar:`PYTHONPATH` 初始化,加上依賴安裝的預設值。"
16971702

16981703
#: ../../library/sys.rst:1370
16991704
msgid ""
17001705
"By default, as initialized upon program startup, a potentially unsafe path "
17011706
"is prepended to :data:`sys.path` (*before* the entries inserted as a result "
17021707
"of :envvar:`PYTHONPATH`):"
17031708
msgstr ""
1709+
"預設情況下,在程式啟動時初始化時,會將一個可能不安全的路徑前置到 :data:`sys.path`(在由於 :envvar:`PYTHONPATH` 而插入的條目*之前*):"
17041710

17051711
#: ../../library/sys.rst:1374
17061712
msgid ""
17071713
"``python -m module`` command line: prepend the current working directory."
17081714
msgstr ""
1715+
"``python -m module`` 命令列:前置目前工作目錄。"
17091716

17101717
#: ../../library/sys.rst:1376
17111718
msgid ""
17121719
"``python script.py`` command line: prepend the script's directory. If it's a "
17131720
"symbolic link, resolve symbolic links."
17141721
msgstr ""
1722+
"``python script.py`` 命令列:前置指令碼的目錄。如果它是符號連結,則解析符號連結。"
17151723

17161724
#: ../../library/sys.rst:1378
17171725
msgid ""
17181726
"``python -c code`` and ``python`` (REPL) command lines: prepend an empty "
17191727
"string, which means the current working directory."
17201728
msgstr ""
1729+
"``python -c code`` 和 ``python``(REPL)命令列:前置空字串,這表示目前工作目錄。"
17211730

17221731
#: ../../library/sys.rst:1381
17231732
msgid ""
17241733
"To not prepend this potentially unsafe path, use the :option:`-P` command "
17251734
"line option or the :envvar:`PYTHONSAFEPATH` environment variable."
17261735
msgstr ""
1736+
"為了不前置這個可能不安全的路徑,請使用 :option:`-P` 命令列選項或 :envvar:`PYTHONSAFEPATH` 環境變數。"
17271737

17281738
#: ../../library/sys.rst:1384
17291739
msgid ""
17301740
"A program is free to modify this list for its own purposes. Only strings "
17311741
"should be added to :data:`sys.path`; all other data types are ignored during "
17321742
"import."
17331743
msgstr ""
1744+
"程式可以自由地為自己的目的修改這個清單。只能將字串加入到 :data:`sys.path`;所有其他資料型別在匯入時會被忽略。"
17341745

17351746
#: ../../library/sys.rst:1390
17361747
msgid ""
17371748
"Module :mod:`site` This describes how to use .pth files to extend :data:`sys."
17381749
"path`."
17391750
msgstr ""
1751+
"模組 :mod:`site` 這描述了如何使用 .pth 檔案來擴展 :data:`sys.path`。"
17401752

17411753
#: ../../library/sys.rst:1395
17421754
msgid ""
@@ -2630,12 +2642,14 @@ msgid ""
26302642
"version information out of it, rather, use :data:`version_info` and the "
26312643
"functions provided by the :mod:`platform` module."
26322644
msgstr ""
2645+
"包含 Python 直譯器版本號碼以及建置號碼和所使用編譯器的額外資訊的字串。這個字串會在啟動互動式直譯器時顯示。不要從中擷取版本資訊,而是應使用 :data:`version_info` 和 :mod:`platform` 模組提供的函式。"
26332646

26342647
#: ../../library/sys.rst:2016
26352648
msgid ""
26362649
"The C API version for this interpreter. Programmers may find this useful "
26372650
"when debugging version conflicts between Python and extension modules."
26382651
msgstr ""
2652+
"此直譯器的 C API 版本。程式設計師在除錯 Python 和擴充模組之間的版本衝突時可能會發現這很有用。"
26392653

26402654
#: ../../library/sys.rst:2022
26412655
msgid ""
@@ -2647,6 +2661,7 @@ msgid ""
26472661
"also be accessed by name, so ``sys.version_info[0]`` is equivalent to ``sys."
26482662
"version_info.major`` and so on."
26492663
msgstr ""
2664+
"包含版本號碼五個組成部分的元組:*major*、*minor*、*micro*、*releaselevel* 和 *serial*。除了 *releaselevel* 以外的所有值都是整數;發布級別是 ``'alpha'``、``'beta'``、``'candidate'`` 或 ``'final'``。對應於 Python 版本 2.0 的 ``version_info`` 值是 ``(2, 0, 0, 'final', 0)``。這些組成部分也可以透過名稱存取,所以 ``sys.version_info[0]`` 等同於 ``sys.version_info.major``,以此類推。"
26502665

26512666
#: ../../library/sys.rst:2030
26522667
msgid "Added named component attributes."

0 commit comments

Comments
 (0)