mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
capitalize H3 headers; add 'cgi.' prefix to example code
This commit is contained in:
parent
ce84920e0c
commit
503e50b0fa
1 changed files with 4 additions and 4 deletions
|
@ -66,7 +66,7 @@ dictionary. For instance, the following code (which assumes that the
|
||||||
Content-type header and blank line have already been printed) checks that
|
Content-type header and blank line have already been printed) checks that
|
||||||
the fields "name" and "addr" are both set to a non-empty string:
|
the fields "name" and "addr" are both set to a non-empty string:
|
||||||
|
|
||||||
form = FieldStorage()
|
form = cgi.FieldStorage()
|
||||||
form_ok = 0
|
form_ok = 0
|
||||||
if form.has_key("name") and form.has_key("addr"):
|
if form.has_key("name") and form.has_key("addr"):
|
||||||
if form["name"].value != "" and form["addr"].value != "":
|
if form["name"].value != "" and form["addr"].value != "":
|
||||||
|
@ -1054,7 +1054,7 @@ def print_environ():
|
||||||
keys = environ.keys()
|
keys = environ.keys()
|
||||||
keys.sort()
|
keys.sort()
|
||||||
print
|
print
|
||||||
print "<H3>Shell environment:</H3>"
|
print "<H3>Shell Environment:</H3>"
|
||||||
print "<DL>"
|
print "<DL>"
|
||||||
for key in keys:
|
for key in keys:
|
||||||
print "<DT>", escape(key), "<DD>", escape(environ[key])
|
print "<DT>", escape(key), "<DD>", escape(environ[key])
|
||||||
|
@ -1066,7 +1066,7 @@ def print_form(form):
|
||||||
keys = form.keys()
|
keys = form.keys()
|
||||||
keys.sort()
|
keys.sort()
|
||||||
print
|
print
|
||||||
print "<H3>Form contents:</H3>"
|
print "<H3>Form Contents:</H3>"
|
||||||
print "<DL>"
|
print "<DL>"
|
||||||
for key in keys:
|
for key in keys:
|
||||||
print "<DT>" + escape(key) + ":",
|
print "<DT>" + escape(key) + ":",
|
||||||
|
@ -1090,7 +1090,7 @@ def print_directory():
|
||||||
|
|
||||||
def print_arguments():
|
def print_arguments():
|
||||||
print
|
print
|
||||||
print "<H3>Command line Arguments:</H3>"
|
print "<H3>Command Line Arguments:</H3>"
|
||||||
print
|
print
|
||||||
print sys.argv
|
print sys.argv
|
||||||
print
|
print
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue