3
3
# This file is distributed under the same license as the Python package.
4
4
#
5
5
# Translators:
6
+ # SkyLull
6
7
msgid ""
7
8
msgstr ""
8
9
"Project-Id-Version : Python 3.13\n "
@@ -22,7 +23,7 @@ msgstr ""
22
23
msgid ""
23
24
":mod:`!argparse` --- Parser for command-line options, arguments and "
24
25
"subcommands"
25
- msgstr ""
26
+ msgstr ":mod:`!argparse` --- 命令列界面選項、參數與子命令的剖析器 "
26
27
27
28
#: ../../library/argparse.rst:12
28
29
msgid "**Source code:** :source:`Lib/argparse.py`"
@@ -37,7 +38,7 @@ msgid ""
37
38
"This page contains the API reference information. For a more gentle "
38
39
"introduction to Python command-line parsing, have a look at the :ref:"
39
40
"`argparse tutorial <argparse-tutorial>`."
40
- msgstr ""
41
+ msgstr "這個頁面含有很多 API 參考資訊。`argparse tutorial <argparse-tutorial>` 有更簡單易懂的 Python 命令剖析教學。 "
41
42
42
43
#: ../../library/argparse.rst:22
43
44
msgid ""
@@ -47,15 +48,17 @@ msgid ""
47
48
"mod:`!argparse` module also automatically generates help and usage "
48
49
"messages. The module will also issue errors when users give the program "
49
50
"invalid arguments."
50
- msgstr ""
51
+ msgstr "使用 :mod:`!argparse` 模組可輕易地寫出一個對使用者友善的命命列界面。你只要告訴 :mod:`!argparse` 你的程式需要什麼參數,它會自動幫你做好如何剖析 :data:`sys.argv` 的設定。"
52
+ ":data:`sys.argv` 還會自動幫你生成幫助和使用說明,以及自動檢查使用者的輸入是否合規。"
51
53
52
54
#: ../../library/argparse.rst:28
53
55
msgid ""
54
56
"The :mod:`!argparse` module's support for command-line interfaces is built "
55
57
"around an instance of :class:`argparse.ArgumentParser`. It is a container "
56
58
"for argument specifications and has options that apply to the parser as "
57
59
"whole::"
58
- msgstr ""
60
+ msgstr ":class:`argparse.ArgumentParser` 是一個供你客製化參數規則和控制剖析器(parser)的容器。"
61
+ "控制 :mod:`!argparse` 如何應對命令列界面的核心,都圍繞在控制一個 argparse.ArgumentParser 的實例之上:::"
59
62
60
63
#: ../../library/argparse.rst:32
61
64
msgid ""
@@ -64,13 +67,19 @@ msgid ""
64
67
" description='What the program does',\n"
65
68
" epilog='Text at the bottom of help')"
66
69
msgstr ""
70
+ "parser = argparse.ArgumentParser(\n"
71
+ " prog='程式名稱',\n"
72
+ " description='程式的用途說明',\n"
73
+ " epilog='幫助訊息底下的文字')"
67
74
68
75
#: ../../library/argparse.rst:37
69
76
msgid ""
70
77
"The :meth:`ArgumentParser.add_argument` method attaches individual argument "
71
78
"specifications to the parser. It supports positional arguments, options "
72
79
"that accept values, and on/off flags::"
73
80
msgstr ""
81
+ ":meth:`ArgumentParser.add_argument` 方法可以將你設定好的每個參數與其規則各自附加進剖析器裡。"
82
+ "它支援位置參數(positional arguments)、接受值的選項以及開關旗標(on/off flags):::"
74
83
75
84
#: ../../library/argparse.rst:41
76
85
msgid ""
@@ -79,25 +88,35 @@ msgid ""
79
88
"parser.add_argument('-v', '--verbose',\n"
80
89
" action='store_true') # on/off flag"
81
90
msgstr ""
91
+ "parser.add_argument('filename') # 位置參數\n"
92
+ "parser.add_argument('-c', '--count') # 接受值的選項\n"
93
+ "parser.add_argument('-v', '--verbose',\n"
94
+ " action='store_true') # 開關旗標"
82
95
83
96
#: ../../library/argparse.rst:46
84
97
msgid ""
85
98
"The :meth:`ArgumentParser.parse_args` method runs the parser and places the "
86
99
"extracted data in a :class:`argparse.Namespace` object::"
87
100
msgstr ""
101
+ ":meth:`ArgumentParser.parse_args` 方法執行剖析並將結果資料存放在一個 :class:`argparse.Namespace` 物件裡:::"
88
102
89
103
#: ../../library/argparse.rst:49
90
104
msgid ""
91
105
"args = parser.parse_args()\n"
92
106
"print(args.filename, args.count, args.verbose)"
93
107
msgstr ""
108
+ "args = parser.parse_args()\n"
109
+ "print(args.filename, args.count, args.verbose)"
94
110
95
111
#: ../../library/argparse.rst:53
96
112
msgid ""
97
113
"If you're looking for a guide about how to upgrade :mod:`optparse` code to :"
98
114
"mod:`!argparse`, see :ref:`Upgrading Optparse Code <upgrading-optparse-"
99
115
"code>`."
100
116
msgstr ""
117
+ "如果你在尋找的是如何把使用 :mod:`optparse` 的程式升級成使用 :mod:`!argparse` 的指引的話,"
118
+ "請參看 :ref:`Upgrading Optparse Code <upgrading-optparse-"
119
+ "code>`."
101
120
102
121
#: ../../library/argparse.rst:57
103
122
msgid "ArgumentParser objects"
@@ -109,36 +128,42 @@ msgid ""
109
128
"as keyword arguments. Each parameter has its own more detailed description "
110
129
"below, but in short they are:"
111
130
msgstr ""
131
+ "建立一個新的 :class:`ArgumentParser` 物件。所有給予它的參數都應使用關鍵字引數來指定。"
132
+ "下方會有每個參數各自的詳細說明,不過簡單來說他們的功用分別是:"
112
133
113
134
#: ../../library/argparse.rst:70
114
135
msgid ""
115
136
"prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)"
116
137
msgstr ""
138
+ "prog_ - 程式的名字。(預設是: ``os.path.basename(sys.argv[0])``)。"
117
139
118
140
#: ../../library/argparse.rst:73
119
141
msgid ""
120
142
"usage_ - The string describing the program usage (default: generated from "
121
143
"arguments added to parser)"
122
144
msgstr ""
145
+ "usage_ - 描述程式用途的字串。(預設值: 從附加到剖析器的參數中生成。)"
123
146
124
147
#: ../../library/argparse.rst:76
125
148
msgid ""
126
149
"description_ - Text to display before the argument help (by default, no text)"
127
150
msgstr ""
151
+ "description_ - 顯示在參數幫助說明前的文字。(預設沒有)"
128
152
129
153
#: ../../library/argparse.rst:79
130
154
msgid "epilog_ - Text to display after the argument help (by default, no text)"
131
- msgstr ""
155
+ msgstr "epilog_ - 顯示在參數幫助說明後的文字。(預設沒有) "
132
156
133
157
#: ../../library/argparse.rst:81
134
158
msgid ""
135
159
"parents_ - A list of :class:`ArgumentParser` objects whose arguments should "
136
160
"also be included"
137
161
msgstr ""
162
+ "parents_ - 一個所有應該被一併列入考量的 :class:`ArgumentParser` 形成的串列。"
138
163
139
164
#: ../../library/argparse.rst:84
140
165
msgid "formatter_class_ - A class for customizing the help output"
141
- msgstr ""
166
+ msgstr "formatter_class_ - 能自訂幫助說明文字的類別 "
142
167
143
168
#: ../../library/argparse.rst:86
144
169
msgid ""
0 commit comments