@@ -67,36 +67,40 @@ msgid ""
6767"produce that with :kbd:`Ctrl-D` on UNIX or :kbd:`Ctrl-Z, Enter` on Windows) "
6868"is read."
6969msgstr ""
70+ "当调用时附带连接到某个 tty 设备的标准输入时,它会提示输入命令并执行它们,直到读入一个 EOF(文件结束字符,其产生方式是在 UNIX 中按 "
71+ ":kbd:`Ctrl-D` 或在 Windows 中按 :kbd:`Ctrl-Z, Enter`。)"
7072
7173#: ../../using/cmdline.rst:45
7274msgid ""
7375"When called with a file name argument or with a file as standard input, it "
7476"reads and executes a script from that file."
75- msgstr ""
77+ msgstr "当调用时附带一个文件名参数或以一个文件作为标准输入时,它会从该文件读取并执行脚本程序。 "
7678
7779#: ../../using/cmdline.rst:47
7880msgid ""
7981"When called with a directory name argument, it reads and executes an "
8082"appropriately named script from that directory."
81- msgstr ""
83+ msgstr "当调用时附带一个目录名参数时,它会从该目录读取并执行具有适当名称的脚本程序。 "
8284
8385#: ../../using/cmdline.rst:49
8486msgid ""
8587"When called with ``-c command``, it executes the Python statement(s) given "
8688"as *command*. Here *command* may contain multiple statements separated by "
8789"newlines. Leading whitespace is significant in Python statements!"
8890msgstr ""
91+ "当调用时附带 ``-c command`` 时,它会执行 *command* 所给出的 Python 语句。 在这里 *command* "
92+ "可以包含以换行符分隔的多条语句。 请注意前导空格在 Python 语句中是有重要作用的!"
8993
9094#: ../../using/cmdline.rst:52
9195msgid ""
9296"When called with ``-m module-name``, the given module is located on the "
9397"Python module path and executed as a script."
94- msgstr ""
98+ msgstr "当调用时附带 ``-m module-name`` 时,会在 Python 模块路径中查找指定的模块,并将其作为脚本程序执行。 "
9599
96100#: ../../using/cmdline.rst:55
97101msgid ""
98102"In non-interactive mode, the entire input is parsed before it is executed."
99- msgstr ""
103+ msgstr "在非交互模式下,会对全部输入先解析再执行。 "
100104
101105#: ../../using/cmdline.rst:57
102106msgid ""
@@ -105,13 +109,17 @@ msgid ""
105109"note that the first element, subscript zero (``sys.argv[0]``), is a string "
106110"reflecting the program's source."
107111msgstr ""
112+ "一个接口选项会终结解释器所读入的选项列表,后续的所有参数将被放入 :data:`sys.argv` -- 请注意其中首个元素即第零项 "
113+ "(``sys.argv[0]``) 会是一个表示程序源的字符串。"
108114
109115#: ../../using/cmdline.rst:64
110116msgid ""
111117"Execute the Python code in *command*. *command* can be one or more "
112118"statements separated by newlines, with significant leading whitespace as in "
113119"normal module code."
114120msgstr ""
121+ "执行 *command* 中的 Python 代码。 *command* "
122+ "可以为一条或以换行符分隔的多条语句,其中前导空格像在普通模块代码中一样具有作用。"
115123
116124#: ../../using/cmdline.rst:68
117125msgid ""
@@ -120,12 +128,14 @@ msgid ""
120128":data:`sys.path` (allowing modules in that directory to be imported as top "
121129"level modules)."
122130msgstr ""
131+ "如果给出此选项,:data:`sys.argv` 的首个元素将为 ``\" -c\" `` 并且当前目录将被加入 :data:`sys.path` "
132+ "的开头(以允许该目录中的模块作为最高层级模块被导入)。"
123133
124134#: ../../using/cmdline.rst:76
125135msgid ""
126136"Search :data:`sys.path` for the named module and execute its contents as the"
127137" :mod:`__main__` module."
128- msgstr ""
138+ msgstr "在 :data:`sys.path` 中搜索指定名称的模块并将其内容作为 :mod:`__main__` 模块来执行。 "
129139
130140#: ../../using/cmdline.rst:79
131141msgid ""
@@ -134,6 +144,8 @@ msgid ""
134144"but the implementation may not always enforce this (e.g. it may allow you to"
135145" use a name that includes a hyphen)."
136146msgstr ""
147+ "由于该参数为 *module* 名称,你不应给出文件扩展名 (``.py``)。 模块名称应为绝对有效的 Python "
148+ "模块名称,但具体实现可能并不总是强制要求这一点(例如它可能允许你使用包含连字符的名称)。"
137149
138150#: ../../using/cmdline.rst:84
139151msgid ""
@@ -143,6 +155,8 @@ msgid ""
143155"deliberately similar to the handling of directories and zipfiles that are "
144156"passed to the interpreter as the script argument."
145157msgstr ""
158+ "包名称(包括命名空间包)也允许使用。 当所提供的是包名称而非普通模块名称时,解释器将把 ``<pkg>.__main__`` 作为主模块来执行。 "
159+ "此行为特意被设计为与作为脚本参数传递给解释器的目录和 zip 文件的处理方式类似。"
146160
147161#: ../../using/cmdline.rst:93
148162msgid ""
@@ -151,6 +165,7 @@ msgid ""
151165"still be used for precompiled modules, even if the original source file is "
152166"not available."
153167msgstr ""
168+ "此选项不适用于内置模块和以 C 编写的扩展模块,因为它们并没有对应的 Python 模块文件。 但是它仍然适用于预编译的模块,即使没有可用的初始源文件。"
154169
155170#: ../../using/cmdline.rst:98
156171msgid ""
@@ -159,45 +174,48 @@ msgid ""
159174"first element will be set to ``\" -m\" ``). As with the :option:`-c` option, "
160175"the current directory will be added to the start of :data:`sys.path`."
161176msgstr ""
177+ "如果给出此选项,:data:`sys.argv` 的首个元素将为模块文件的完整路径 (在定位模块文件期间,首个元素将设为 ``\" -m\" ``)。 与 "
178+ ":option:`-c` 选项一样,当前目录将被加入 :data:`sys.path` 的开头。"
162179
163180#: ../../using/cmdline.rst:103
164181msgid ""
165182"Many standard library modules contain code that is invoked on their "
166183"execution as a script. An example is the :mod:`timeit` module::"
167- msgstr ""
184+ msgstr "许多标准库模块都包含作为脚本执行时会被发起调用的代码。 其中的一个例子是 :mod:`timeit` 模块:: "
168185
169186#: ../../using/cmdline.rst:111
170187msgid ":func:`runpy.run_module`"
171- msgstr ""
188+ msgstr ":func:`runpy.run_module` "
172189
173190#: ../../using/cmdline.rst:111 ../../using/cmdline.rst:153
174191msgid "Equivalent functionality directly available to Python code"
175- msgstr ""
192+ msgstr "Python 代码可以直接使用的等效功能 "
176193
177194#: ../../using/cmdline.rst:113
178195msgid ":pep:`338` -- Executing modules as scripts"
179- msgstr ""
196+ msgstr ":pep:`338` -- 将模块作为脚本执行 "
180197
181198#: ../../using/cmdline.rst:116
182199msgid "Supply the package name to run a ``__main__`` submodule."
183- msgstr ""
200+ msgstr "提供包名称来运行 ``__main__`` 子模块。 "
184201
185202#: ../../using/cmdline.rst:119
186203msgid "namespace packages are also supported"
187- msgstr ""
204+ msgstr "同样支持命名空间包 "
188205
189206#: ../../using/cmdline.rst:125
190207msgid ""
191208"Read commands from standard input (:data:`sys.stdin`). If standard input is"
192209" a terminal, :option:`-i` is implied."
193- msgstr ""
210+ msgstr "从标准输入 (:data:`sys.stdin`) 读取命令。 如果标准输入为一个终端,则使用 :option:`-i`。 "
194211
195212#: ../../using/cmdline.rst:128
196213msgid ""
197214"If this option is given, the first element of :data:`sys.argv` will be "
198215"``\" -\" `` and the current directory will be added to the start of "
199216":data:`sys.path`."
200217msgstr ""
218+ "如果给出此选项,:data:`sys.argv` 的首个元素将为 ``\" -\" `` 并且当前目录将被加入 :data:`sys.path` 的开头。"
201219
202220#: ../../using/cmdline.rst:135
203221msgid ""
0 commit comments