spyce
         
home     documentation     download     Spyce logo


Examples

examples/handlerintro.spy
[[!
def calculate(self, api, x, y):
    self.result = x * y
]]

<spy:parent title="Active Handler example" />
<f:form>
    <f:text name="x:float" default="2" label="first value" />
    <f:text name="y:float" default="3" label="second value" />

    <f:submit handler="self.calculate" value="Multiply" />
</f:form>

<p>
Result: [[= hasattr(self, 'result') and self.result or '(no result yet)' ]]
</p>
Run this code

Back to List of Examples


Spyce logo
Python Server Pages
version 2.1.3
Spyce Powered SourceForge Logo