of CGI scripts, after all. Let’s start using this to better advantage now, and write a Python
script that builds up response HTML programmatically, listed in Example 15-5.
Example 15-5. PP4E\Internet\Web\cgi-bin\tutor2.py
#!/usr/bin/python
print("""Content-type: text/html
A Third CGI Script
Hello, CGI World!
%d.%d | ' % (i, j))
""")
Despite all the tags, this really is Python code—the tutor2.py script uses triple-quoted
strings to embed blocks of HTML again. But this time, the script also uses nested Python
Figure 15-4. A page with an image generated by tutor1.py
Climbing the CGI Learning Curve| 1147