#!/Library/Frameworks/Python.framework/Versions/Current/bin/python
# L-23 MCS 275 Fri 5 Mar 2010 : web_det.py
import cgi
def PrintHeader(title):
"""
writes title and header of page
"""
print """Content-type: text/html
%s
""" % title
def AskDimension():
"""
form to enter the dimension
"""
print """"""
def AskMatrix(n):
"""
form to enter an n-by-n matrix
"""
print """"
def main():
"""
web interface to compute a determinant
"""
PrintHeader("compute determinant")
AskDimension()
form = cgi.FieldStorage()
if form.has_key("dim"):
n = int(form["dim"].value)
AskMatrix(n)
print "\n"
main()