add python-cgi-template.py
This commit is contained in:
parent
dfdae3540b
commit
7308c254a7
27
python-cgi-template.py
Executable file
27
python-cgi-template.py
Executable 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()
|
Loading…
x
Reference in New Issue
Block a user