hey
with this code that ive written, im not sure why its not outputting a value for the BMI..
can anyone help??
thanks
def application(environ, start_response):
headers = [('content-type', 'text/html')]
start_response('200 OK', headers)
formdata = cgi.FieldStorage(environ=environ, fp=environ['wsgi.input'])
if formdata.has_key('Mass') and formdata.has_key('Height'):
Mass = float(formdata.getvalue('Mass'))
Height = float(formdata.getvalue('Height'))
BMI = formdata.getvalue('Mass/(Height*Height)')
forminfo = "<p>Mass= %s, Height=%s, BMI=%s</p>" % (Mass, Height, BMI)
else:
forminfo = "no data input"
page = ["<html>", BMI_form, forminfo, "</html>"]
return page