--- webservers.txt 2008-12-04 07:15:58.000000000 -0600 +++ webservers-3k.txt 2008-12-05 10:48:30.000000000 -0600 @@ -95,16 +95,16 @@ To test whether your web server works with CGI, you can use this short and simple CGI program:: - #!/usr/bin/env python + #!/usr/bin/env python3.0 # -*- coding: UTF-8 -*- # enable debugging import cgitb; cgitb.enable() - print "Content-Type: text/plain;charset=utf-8" - print + print("Content-Type: text/plain;charset=utf-8") + print() - print "Hello World!" + print("Hello World!") You need to write this code into a file with a ``.py`` or ``.cgi`` extension, this depends on your web server configuration. Depending on your web server @@ -275,7 +275,7 @@ Once you have installed and configured the module, you can test it with the following WSGI-application:: - #!/usr/bin/env python + #!/usr/bin/env python3.0 # -*- coding: UTF-8 -*- from cgi import escape @@ -285,11 +285,12 @@ def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) - yield '
%s | %s |
---|