|
 |
 |
 |
Examples
|
[[ Spyce ]]
Python Server Pages by Rimon Barr |
examples/include.spy
|
[[.import name=include]]
<html><body>
main file<br>
<hr>
[[
context = {'foo': 'old value'}
result=include.spyce('include.spi', context)
]]
<hr>
main file again<br>
context: [[=context]]<br>
return value: [[=result]]<br>
</body></html>
|
Run this code.
(requires Spyce-enabled web server)
|
Supplemental files:
examples/include.spi
|
begin include<br>
context: [[=include.context ]]<br>
from: [[=include.fromFile ]]<br>
foo was [[=include.vars.foo]]<br>
setting foo to 'new value' [[include.vars.foo = 'new value']]<br>
returing 'retval'<br>
end include<br>
[[ return 'retval' ]]
|
Back to List of Examples
|