Dump the contents of a form as HTML.
(form)
| 915 | print() |
| 916 | |
| 917 | def print_form(form): |
| 918 | """Dump the contents of a form as HTML.""" |
| 919 | keys = sorted(form.keys()) |
| 920 | print() |
| 921 | print("<H3>Form Contents:</H3>") |
| 922 | if not keys: |
| 923 | print("<P>No form fields.") |
| 924 | print("<DL>") |
| 925 | for key in keys: |
| 926 | print("<DT>" + html.escape(key) + ":", end=' ') |
| 927 | value = form[key] |
| 928 | print("<i>" + html.escape(repr(type(value))) + "</i>") |
| 929 | print("<DD>" + html.escape(repr(value))) |
| 930 | print("</DL>") |
| 931 | print() |
| 932 | |
| 933 | def print_directory(): |
| 934 | """Dump the current directory as HTML.""" |