add python-cgi-template.py

This commit is contained in:
Josh Holtrop 2011-03-04 20:00:37 -05:00
parent dfdae3540b
commit 7308c254a7

27
python-cgi-template.py Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env python
import cgi
from subprocess import *
# Enable these for debugging
#import cgitb
#cgitb.enable()
def header():
print "Content-Type: text/html\n"
def printHead(title):
print '''<head>
<title>%s</title>
</head>''' % title
def main():
header()
print '<html>'
printHead('Title')
print '<body>'
print '<h2>%s</h2>' % 'Title'
print '</body></html>'
if __name__ == "__main__":
main()