@@ -37,7 +37,7 @@ msgid ""
3737"This page contains the API reference information. For a more gentle "
3838"introduction to Python command-line parsing, have a look at the "
3939":ref:`argparse tutorial <argparse-tutorial>`."
40- msgstr ""
40+ msgstr "此页面包含 API 参考信息。有关 Python 命令行解析的更文雅的介绍,请参阅 <argparse-tutorial>。 "
4141
4242#: ../../library/argparse.rst:22
4343msgid ""
@@ -47,46 +47,49 @@ msgid ""
4747" The :mod:`argparse` module also automatically generates help and usage "
4848"messages and issues errors when users give the program invalid arguments."
4949msgstr ""
50+ ":mod:`argparse` 模块可以轻松编写用户友好的命令行接口。程序定义它需要的参数,然后 :mod:`argparse` 将弄清如何从 "
51+ ":data:`sys.argv` 解析出那些参数。 :mod:`argparse` "
52+ "模块还会自动生成帮助和使用手册,并在用户给程序传入无效参数时报出错误信息。"
5053
5154#: ../../library/argparse.rst:30
5255msgid "Example"
53- msgstr ""
56+ msgstr "示例 "
5457
5558#: ../../library/argparse.rst:32
5659msgid ""
5760"The following code is a Python program that takes a list of integers and "
5861"produces either the sum or the max::"
59- msgstr ""
62+ msgstr "以下代码是一个 Python 程序,它获取一个整数列表并计算合计或者最大值: "
6063
6164#: ../../library/argparse.rst:47
6265msgid ""
6366"Assuming the Python code above is saved into a file called ``prog.py``, it "
6467"can be run at the command line and provides useful help messages:"
65- msgstr ""
68+ msgstr "假设上面的 Python 代码保存在名为 ``prog.py`` 的文件中,它可以在命令行运行并提供有用的帮助消息: "
6669
6770#: ../../library/argparse.rst:64
6871msgid ""
6972"When run with the appropriate arguments, it prints either the sum or the max"
7073" of the command-line integers:"
71- msgstr ""
74+ msgstr "使用适当的参数运行时,它会输出命令行传入整数的总和或者最大值: "
7275
7376#: ../../library/argparse.rst:75
7477msgid "If invalid arguments are passed in, it will issue an error:"
75- msgstr ""
78+ msgstr "如果传入无效参数,则会报出错误: "
7679
7780#: ../../library/argparse.rst:83
7881msgid "The following sections walk you through this example."
79- msgstr ""
82+ msgstr "以下部分将引导你完成这个示例。 "
8083
8184#: ../../library/argparse.rst:87
8285msgid "Creating a parser"
83- msgstr ""
86+ msgstr "创建一个解析器 "
8487
8588#: ../../library/argparse.rst:89
8689msgid ""
8790"The first step in using the :mod:`argparse` is creating an "
8891":class:`ArgumentParser` object::"
89- msgstr ""
92+ msgstr "使用 :mod:`argparse` 的第一步是创建一个 :class:`ArgumentParser` 对象: "
9093
9194#: ../../library/argparse.rst:94
9295msgid ""
0 commit comments