Ich hab mal wieder ein "kleines" Problem.
Folgendes Script hab ich erstellt, welches aus einem HTML Formular 2 Zahlen und einen String mit der Berechnungsmethode übergeben bekommt.
Code: Alles auswählen
"""
Small Python Calculator
"""
if calcMethod == "add":
z3 = float(z1) + float(z2)
elif calcMethod == "divide":
z3 = float(z1) / float(z2)
elif calcMethod == "minus":
z3 = float(z1) - float(z2)
elif calcMethod == "multiply":
z3 = float(z1) * float(z2)
page = container['results.html']
return z3, calcMethod
Das Resultfile (da ist denk ich was falsch) schaut so aus:
Code: Alles auswählen
<html>
<body>
<h1 tal:content="calc/calcMethod">calc method</h1>
<h1 tal:content="calc/z3">result</h1>
</body>
</html>
Danke,
Johannes