Home || Syllabus || Class Notes || Assignments || Resources || Tutoring


Fall, 2009 Python - Class Discussion on using Python to prepare scripts for the web

NOTE: This is *optional* material ... it will not be on the final exam.

#!/usr/local/bin/python
import cgi

print "Content-Type: text/html" # HTML is following
print # blank line, end of headers

print "<html><head>"
print "<TITLE>CGI script output</TITLE></head>"
print "<body><H3>This CGI script uses Python.</H3>"
print "<b>Hello,</b> <i>world!</i>"
print "</body></html>"