#!/usr/bin/env /s/bin/python2.4 # # Basic CGI example - add two numbers import cgi # We need the header no matter what: print 'Content-Type: text/html' print print '' print '' print '
Please fill out both fields.
" else: try: X = float(form["X"].value) # all CGI values strings Y = float(form["Y"].value) print "The answer is %s.
" % (X + Y) except ValueError: print "Both fields must be numbers.
" print ' ' # EOF