@@ -41,7 +41,7 @@ msgstr "通用网关接口 (CGI) 脚本的支持模块"
4141msgid ""
4242"This module defines a number of utilities for use by CGI scripts written in "
4343"Python."
44- msgstr ""
44+ msgstr "本模块定义了一些工具供以 Python 编写的 CGI 脚本使用。 "
4545
4646#: ../../library/cgi.rst:26
4747msgid "Introduction"
@@ -52,6 +52,7 @@ msgid ""
5252"A CGI script is invoked by an HTTP server, usually to process user input "
5353"submitted through an HTML ``<FORM>`` or ``<ISINDEX>`` element."
5454msgstr ""
55+ "CGI 脚本是由 HTTP 服务器发起调用,通常用来处理通过 HTML ``<FORM>`` 或 ``<ISINDEX>`` 元素提交的用户输入。"
5556
5657#: ../../library/cgi.rst:33
5758msgid ""
@@ -61,6 +62,9 @@ msgid ""
6162"lots of other goodies) in the script's shell environment, executes the "
6263"script, and sends the script's output back to the client."
6364msgstr ""
65+ "在大多数情况下,CGI 脚本存放在服务器的 :file:`cgi-bin` 特殊目录下。 HTTP "
66+ "服务器将有关请求的各种信息(例如客户端的主机名、所请求的 URL、查询字符串以及许多其他内容)放在脚本的 shell "
67+ "环境中,然后执行脚本,并将脚本的输出发回到客户端。"
6468
6569#: ../../library/cgi.rst:39
6670msgid ""
@@ -72,6 +76,9 @@ msgid ""
7276"the latest addition is support for file uploads from a form (if your browser"
7377" supports it)."
7478msgstr ""
79+ "脚本的输入也会被连接到客户端,并且有时表单数据也会以此方式来读取;在其他时候表单数据会通过 URL 的“查询字符串”部分来传递。 "
80+ "本模块的目标是处理不同的应用场景并向 Python 脚本提供一个更为简单的接口。 "
81+ "它还提供了一些工具为脚本调试提供帮助,而最近增加的还有对通过表单上传文件的支持(如果你的浏览器支持该功能的话)。"
7582
7683#: ../../library/cgi.rst:46
7784msgid ""
@@ -80,13 +87,16 @@ msgid ""
8087"client what kind of data is following. Python code to generate a minimal "
8188"header section looks like this::"
8289msgstr ""
90+ "CGI 脚本的输出应当由两部分组成,并由一个空行分隔。 前一部分包含一些标头,它们告诉客户端后面会提供何种数据。 生成一个最小化标头部分的 Python"
91+ " 代码如下所示::"
8392
8493#: ../../library/cgi.rst:54
8594msgid ""
8695"The second section is usually HTML, which allows the client software to "
8796"display nicely formatted text with header, in-line images, etc. Here's "
8897"Python code that prints a simple piece of HTML::"
8998msgstr ""
99+ "后一部分通常为 HTML,提供给客户端软件来显示格式良好包含标题的文本、内联图片等内容。 下面是打印一段简单 HTML 的 Python 代码::"
90100
91101#: ../../library/cgi.rst:66
92102msgid "Using the cgi module"
@@ -115,6 +125,8 @@ msgid ""
115125"time in tracking down bugs. You can always remove the ``cgitb`` line later "
116126"when you have tested your script and are confident that it works correctly."
117127msgstr ""
128+ "在脚本开发期间使用此特性会很有帮助。 :mod:`cgitb` 所产生的报告提供了在追踪程序问题时能为你节省大量时间的信息。 "
129+ "你可以在完成测试你的脚本并确信它能正确工作之后再移除 ``cgitb`` 行。"
118130
119131#: ../../library/cgi.rst:88
120132msgid ""
0 commit comments