Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1d706d

Browse files
committed
wip
1 parent950d450 commitf1d706d

File tree

1 file changed

+91
-13
lines changed

1 file changed

+91
-13
lines changed

‎library/code.po

Lines changed: 91 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2022, Python Software Foundation
1+
# Copyright (C) 2001-2024, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
43
#
54
# Translators:
5+
# Matt Wang <mattwang44@gmail.com>, 2024
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.13\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2024-09-23 07:52+0800\n"
11-
"PO-Revision-Date:2018-05-23 14:40+0000\n"
12-
"Last-Translator:Adrian Liaw <adrianliaw2000@gmail.com>\n"
11+
"PO-Revision-Date:2024-10-28 14:40+0000\n"
12+
"Last-Translator:Matt Wang <mattwang44@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
1515
"Language: zh_TW\n"
@@ -27,13 +27,17 @@ msgid "**Source code:** :source:`Lib/code.py`"
2727
msgstr "**原始碼:**\\ :source:`Lib/code.py`"
2828

2929
#: ../../library/code.rst:11
30+
#, fuzzy
3031
msgid ""
3132
"The ``code`` module provides facilities to implement read-eval-print loops "
3233
"in Python. Two classes and convenience functions are included which can be "
3334
"used to build applications which provide an interactive interpreter prompt."
3435
msgstr ""
36+
"``code`` 模組提供在 Python 中實作 read-eval-print 環路的設施。包含兩個類別和"
37+
"便利函式,可用於建立提供互動式直譯器提示的應用程式。"
3538

3639
#: ../../library/code.rst:18
40+
#, fuzzy
3741
msgid ""
3842
"This class deals with parsing and interpreter state (the user's namespace); "
3943
"it does not deal with input buffering or prompting or input file naming (the "
@@ -42,6 +46,10 @@ msgid ""
4246
"it defaults to a newly created dictionary with key ``'__name__'`` set to "
4347
"``'__console__'`` and key ``'__doc__'`` set to ``None``."
4448
msgstr ""
49+
"這個類別處理剖析和直譯器狀態(使用者的命名空間);它不處理輸入緩衝、提示或輸"
50+
"入檔案命名(檔案名稱總是明確傳入)。可選的 *locals* 引數指定一個對映,作為執"
51+
"行程式碼的名稱空間;它預設為新建立的字典,鍵 ``'__name__'`` 設為 "
52+
"``'__console__'``,鍵 ``'__doc__'`` 設為 ``None``。"
4553

4654
#: ../../library/code.rst:28
4755
msgid ""
@@ -51,11 +59,14 @@ msgid ""
5159
"is true, ``exit()`` and ``quit()`` in the console will not raise :exc:"
5260
"`SystemExit`, but instead return to the calling code."
5361
msgstr ""
62+
"近似地模擬出互動式 Python 直譯器的行為。這個類別建立在 :class:"
63+
"`InteractiveInterpreter` 的基礎上,並加入使用熟悉的 ``sys.ps1`` 和 ``sys."
64+
"ps2`` 的提示,以及輸入緩衝。如果 *local_exit* 為 true,控制台中的 ``exit()`` "
65+
"和 ``quit()`` 將不會引發 :exc:`SystemExit`,而是回傳到呼叫程式碼。"
5466

5567
#: ../../library/code.rst:34 ../../library/code.rst:52
56-
#, fuzzy
5768
msgid "Added *local_exit* parameter."
58-
msgstr "新增 *exitmsg* 參數。"
69+
msgstr "新增 *local_exit* 參數。"
5970

6071
#: ../../library/code.rst:39
6172
msgid ""
@@ -69,12 +80,21 @@ msgid ""
6980
"*banner* and *exitmsg* passed as the banner and exit message to use, if "
7081
"provided. The console object is discarded after use."
7182
msgstr ""
83+
"執行 read-eval-print 迴圈的便利函式。這會建立一個 :class:"
84+
"`InteractiveConsole` 的新實例,並設定 *readfunc* 以用於 :meth:"
85+
"`InteractiveConsole.raw_input` 方法(如有提供)。如果 *local* 有被提供,它會"
86+
"被傳給 :class:`InteractiveConsole` 的建構函式以作為直譯器迴圈的預設命名空間。"
87+
"如果有提供 *local_exit*,它會被傳給 :class:`InteractiveConsole` 構建函式。然"
88+
"後實例的 :meth:`~InteractiveConsole.interact` 方法會執行,並傳入 *banner* 和 "
89+
"*exitmsg* 以作為要使用的橫幅和退出訊息(如有提供)。控制台物件在使用後就會被"
90+
"丟棄。"
7291

7392
#: ../../library/code.rst:49
7493
msgid "Added *exitmsg* parameter."
7594
msgstr "新增 *exitmsg* 參數。"
7695

7796
#: ../../library/code.rst:57
97+
#, fuzzy
7898
msgid ""
7999
"This function is useful for programs that want to emulate Python's "
80100
"interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is "
@@ -83,6 +103,10 @@ msgid ""
83103
"syntax error). This function *almost* always makes the same decision as the "
84104
"real interpreter main loop."
85105
msgstr ""
106+
"這個函式對於想要模擬 Python 的直譯器主迴圈(即 the read-eval-print 迴圈)的程"
107+
"式很有用。最棘手的部分是判斷使用者何時輸入了一個不完整的命令,而這個命令可以"
108+
"透過輸入更多文字來完成(相對於完整的命令或語法錯誤)。這個函式\\ *幾乎*\\ 總"
109+
"是做出與真正的直譯器主迴圈相同的判斷。"
86110

87111
#: ../../library/code.rst:64
88112
msgid ""
@@ -91,6 +115,9 @@ msgid ""
91115
"optional grammar start symbol, which should be ``'single'`` (the default), "
92116
"``'eval'`` or ``'exec'``."
93117
msgstr ""
118+
"*source* 是來源字串;*filename* 是讀取來源的可選檔案名稱,預設為 "
119+
"``'<input>'``;*symbol* 是可選的文法 (grammar) 起始符號,其應為 "
120+
"``'single'``\\ (預設值)、``'eval'`` 或 ``'exec'``。"
94121

95122
#: ../../library/code.rst:69
96123
msgid ""
@@ -100,17 +127,24 @@ msgid ""
100127
"error, or raises :exc:`OverflowError` or :exc:`ValueError` if the command "
101128
"contains an invalid literal."
102129
msgstr ""
130+
"如果命令完整且有效,則回傳程式碼物件(與 ``compile(source,filename,symbol)`` "
131+
"相同);如果命令不完整,則回傳 ``None``;如果命令完整但包含語法錯誤,則引發 :"
132+
"exc:`SyntaxError`,如果命令包含無效的字面值 (literal),則引發 :exc:"
133+
"`OverflowError` 或 :exc:`ValueError`。"
103134

104135
#: ../../library/code.rst:79
105136
msgid "Interactive Interpreter Objects"
106-
msgstr ""
137+
msgstr "互動式直譯器物件"
107138

108139
#: ../../library/code.rst:84
109140
msgid ""
110141
"Compile and run some source in the interpreter. Arguments are the same as "
111142
"for :func:`compile_command`; the default for *filename* is ``'<input>'``, "
112143
"and for *symbol* is ``'single'``. One of several things can happen:"
113144
msgstr ""
145+
"在直譯器中編譯並執行某些原始碼。引數與 :func:`compile_command` 相同;"
146+
"*filename* 的預設值是 ``'<input>'``,*symbol* 的預設值是 ``'single'``。有幾種"
147+
"情況會發生:"
114148

115149
#: ../../library/code.rst:88
116150
msgid ""
@@ -119,12 +153,17 @@ msgid ""
119153
"by calling the :meth:`showsyntaxerror` method. :meth:`runsource` returns "
120154
"``False``."
121155
msgstr ""
156+
"輸入不正確;:func:`compile_command` 會引發例外(:exc:`SyntaxError` 或 :exc:"
157+
"`OverflowError`)。語法回溯 (syntax traceback) 會透過呼叫 :meth:"
158+
"`showsyntaxerror` 方法來印出。:meth:`runsource` 會回傳 ``False``。"
122159

123160
#: ../../library/code.rst:93
124161
msgid ""
125162
"The input is incomplete, and more input is required; :func:`compile_command` "
126163
"returned ``None``. :meth:`runsource` returns ``True``."
127164
msgstr ""
165+
"輸入不完整,需要更多輸入;:func:`compile_command` 回傳了 ``None``。:meth:"
166+
"`runsource` 會回傳 ``True``。"
128167

129168
#: ../../library/code.rst:96
130169
msgid ""
@@ -133,68 +172,89 @@ msgid ""
133172
"exceptions, except for :exc:`SystemExit`). :meth:`runsource` returns "
134173
"``False``."
135174
msgstr ""
175+
"輸入完整;:func:`compile_command` 回傳一個程式碼物件。程式碼會透過呼叫 :meth:"
176+
"`runcode` 執行(它也會處理執行時的例外,除 :exc:`SystemExit` 以外)。:meth:"
177+
"`runsource` 會回傳 ``False``。"
136178

137179
#: ../../library/code.rst:100
138180
msgid ""
139181
"The return value can be used to decide whether to use ``sys.ps1`` or ``sys."
140182
"ps2`` to prompt the next line."
141-
msgstr ""
183+
msgstr "回傳值可用來決定是使用 ``sys.ps1`` 還是 ``sys.ps2`` 以提示下一列。"
142184

143185
#: ../../library/code.rst:106
144186
msgid ""
145187
"Execute a code object. When an exception occurs, :meth:`showtraceback` is "
146188
"called to display a traceback. All exceptions are caught except :exc:"
147189
"`SystemExit`, which is allowed to propagate."
148190
msgstr ""
191+
"執行程式碼物件。當例外發生時,會呼叫 :meth:`showtraceback` 來顯示回溯。除了 :"
192+
"exc:`SystemExit` 允許繼續傳播之外,所有的例外都會被捕獲。"
149193

150194
#: ../../library/code.rst:110
151195
msgid ""
152196
"A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in "
153197
"this code, and may not always be caught. The caller should be prepared to "
154198
"deal with it."
155199
msgstr ""
200+
"關於 :exc:`KeyboardInterrupt` 的注意事項:此例外可能發生在此程式碼的其他地"
201+
"方,而且不一定會被捕獲到。呼叫者應該準備好處理它。"
156202

157203
#: ../../library/code.rst:117
204+
#, fuzzy
158205
msgid ""
159206
"Display the syntax error that just occurred. This does not display a stack "
160207
"trace because there isn't one for syntax errors. If *filename* is given, it "
161208
"is stuffed into the exception instead of the default filename provided by "
162209
"Python's parser, because it always uses ``'<string>'`` when reading from a "
163210
"string. The output is written by the :meth:`write` method."
164211
msgstr ""
212+
"顯示剛剛發生的語法錯誤。這不會顯示堆疊追蹤,因為語法錯誤沒有堆疊追蹤。如果給"
213+
"出 *filename*,它會被塞入例外,而不是 Python 剖析器提供的預設檔案名稱,因為它"
214+
"從字串讀取時總是使用 ``'<string>'``。輸出會被 :meth:`write` 方法寫入。"
165215

166216
#: ../../library/code.rst:126
217+
#, fuzzy
167218
msgid ""
168219
"Display the exception that just occurred. We remove the first stack item "
169220
"because it is within the interpreter object implementation. The output is "
170221
"written by the :meth:`write` method."
171222
msgstr ""
223+
"顯示剛剛發生的例外。我們移除第一個堆疊項目,因為它在直譯器物件的實作範圍內。"
224+
"輸出由 :meth:`write` 方法寫入。"
172225

173226
#: ../../library/code.rst:130
227+
#, fuzzy
174228
msgid ""
175229
"The full chained traceback is displayed instead of just the primary "
176230
"traceback."
177-
msgstr ""
231+
msgstr "會顯示完整的連鎖追蹤記錄,而不只是主要追蹤記錄。"
178232

179233
#: ../../library/code.rst:136
180234
msgid ""
181235
"Write a string to the standard error stream (``sys.stderr``). Derived "
182236
"classes should override this to provide the appropriate output handling as "
183237
"needed."
184238
msgstr ""
239+
"寫入字串到標準錯誤串流 (``sys.stderr``)。衍生類別應覆寫此功能,以根據需求提供"
240+
"適當的輸出處理。"
185241

186242
#: ../../library/code.rst:143
187243
msgid "Interactive Console Objects"
188-
msgstr ""
244+
msgstr "互動式控制台物件"
189245

190246
#: ../../library/code.rst:145
247+
#, fuzzy
191248
msgid ""
192249
"The :class:`InteractiveConsole` class is a subclass of :class:"
193250
"`InteractiveInterpreter`, and so offers all the methods of the interpreter "
194251
"objects as well as the following additions."
195252
msgstr ""
253+
":class:`InteractiveConsole` 類別是 :class:`InteractiveInterpreter` 的子類別,"
254+
"因此提供了所有直譯器物件的方法以及下列新增的功能。"
196255

197256
#: ../../library/code.rst:152
257+
#, fuzzy
198258
msgid ""
199259
"Closely emulate the interactive Python console. The optional *banner* "
200260
"argument specify the banner to print before the first interaction; by "
@@ -203,23 +263,30 @@ msgid ""
203263
"(so as not to confuse this with the real interpreter -- since it's so "
204264
"close!)."
205265
msgstr ""
266+
"近似地模擬互動式 Python 控制台。可選的 *banner* 引數指定在第一次互動之前要印"
267+
"出的 banner;預設會印出類似標準 Python 直譯器所列印的 banner,接著是控制台物"
268+
"件在括弧中的類別名稱 (以免與真正的直譯器混淆 -- 因為它是如此接近!)。"
206269

207270
#: ../../library/code.rst:158
271+
#, fuzzy
208272
msgid ""
209273
"The optional *exitmsg* argument specifies an exit message printed when "
210274
"exiting. Pass the empty string to suppress the exit message. If *exitmsg* is "
211275
"not given or ``None``, a default message is printed."
212276
msgstr ""
277+
"可選的 *exitmsg* 引數指定退出時列印的退出訊息。傳遞空字串來抑制退出訊息。如果"
278+
"沒有給 *exitmsg* 或 ``None``,則會印出預設訊息。"
213279

214280
#: ../../library/code.rst:162
215281
msgid "To suppress printing any banner, pass an empty string."
216-
msgstr ""
282+
msgstr "若要抑制印出任何橫幅,請傳入空字串。"
217283

218284
#: ../../library/code.rst:165
219285
msgid "Print an exit message when exiting."
220-
msgstr ""
286+
msgstr "退出時印出退出訊息。"
221287

222288
#: ../../library/code.rst:171
289+
#, fuzzy
223290
msgid ""
224291
"Push a line of source text to the interpreter. The line should not have a "
225292
"trailing newline; it may have internal newlines. The line is appended to a "
@@ -231,15 +298,26 @@ msgid ""
231298
"is required, ``False`` if the line was dealt with in some way (this is the "
232299
"same as :meth:`!runsource`)."
233300
msgstr ""
301+
"推送一列原始文字到直譯器。這一列不應該有尾部換行;它可能有內部換行。這列文字"
302+
"會被附加到緩衝區,並且直譯器的 :meth:`~InteractiveInterpreter.runsource` 方法"
303+
"會被呼叫,並以緩衝區的串接內容做為原始碼。如果這表示命令已執行或無效,緩衝區"
304+
"會被重設;否則,命令不完整,緩衝區會保持該行被附加後的樣子。如果需要更多的輸"
305+
"入,回傳值是 ``True``,如果該行已經以某種方式處理,回傳值是 ``False``(這與 :"
306+
"meth:`!runsource` 相同)。"
234307

235308
#: ../../library/code.rst:183
309+
#, fuzzy
236310
msgid "Remove any unhandled source text from the input buffer."
237-
msgstr ""
311+
msgstr "從輸入緩衝區移除任何未處理的來源文字。"
238312

239313
#: ../../library/code.rst:188
314+
#, fuzzy
240315
msgid ""
241316
"Write a prompt and read a line. The returned line does not include the "
242317
"trailing newline. When the user enters the EOF key sequence, :exc:"
243318
"`EOFError` is raised. The base implementation reads from ``sys.stdin``; a "
244319
"subclass may replace this with a different implementation."
245320
msgstr ""
321+
"寫入一個提示並讀取一列。回傳的行不包括尾部的換行符。當使用者輸入 EOF 鍵序時,"
322+
"會產生 :exc:`EFError`。基本實作從 ``sys.stdin`` 讀取;子類別可以用不同的實作"
323+
"取代。"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp