I'm trying to do a step process with data and having difficulty figuring it out. Any help MUCH appreciated!
I want to use a standard form such as input_form.html. The input values will be for values of w, x, y, z (e.g. W: <input name="w" />). From there I want to send the input values to the following function to be classified: class Scenario(object): def __init__(self, w, x, y, z): self.val = {} self.val['w'] = self.value(w,10,50) self.val['x'] = self.value(x,5,15) self.val['y'] = self.value(y,25,75) self.val['z'] = self.value(z,3,7) def value(self, v, l, u): if (v < l): return "low" if (u > v >= l ): return "med" if (v >= u): return "high" def __str__(self): return "scenario = (w: " + self.val['w'] + " x: " + self.val['x'] + " y: " + self.val['y'] + " z: " + self.val['z'] + ")" This will return a scenario = w: w, x: x, y: y, z: z. I'm looking to then match that scenario value against a table of the 80 possible scenarios and retrieve an output for the matching scenario in the table. The output I would send back to the 'next' page from the form along with a print of the scenario in question. Again, any help on this greatly appreciated. Once I see it once I'll be able to get it.