diff options
Diffstat (limited to 'Demo/cgi/cgi2.py')
-rwxr-xr-x | Demo/cgi/cgi2.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Demo/cgi/cgi2.py b/Demo/cgi/cgi2.py index d956f65..239fb6b 100755 --- a/Demo/cgi/cgi2.py +++ b/Demo/cgi/cgi2.py @@ -8,15 +8,15 @@ import cgi def main(): form = cgi.FieldStorage() - print "Content-type: text/html" - print + print("Content-type: text/html") + print() if not form: - print "<h1>No Form Keys</h1>" + print("<h1>No Form Keys</h1>") else: - print "<h1>Form Keys</h1>" - for key in form.keys(): + print("<h1>Form Keys</h1>") + for key in list(form.keys()): value = form[key].value - print "<p>", cgi.escape(key), ":", cgi.escape(value) + print("<p>", cgi.escape(key), ":", cgi.escape(value)) if __name__ == "__main__": main() |